Merge pull request #5699 from appwrite/fix-cache-delete-bug-dbpm
fix delete cache file to dbp-master
This commit is contained in:
commit
ce1ad823b5
2 changed files with 3 additions and 11 deletions
|
@ -359,8 +359,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
|||
->inject('mode')
|
||||
->inject('deviceFiles')
|
||||
->inject('deviceLocal')
|
||||
->inject('deletes')
|
||||
->action(function (string $bucketId, string $fileId, mixed $file, ?array $permissions, Request $request, Response $response, Database $dbForProject, Document $user, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal, Delete $deletes) {
|
||||
->action(function (string $bucketId, string $fileId, mixed $file, ?array $permissions, Request $request, Response $response, Database $dbForProject, Document $user, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal) {
|
||||
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
|
@ -1258,8 +1257,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
->inject('user')
|
||||
->inject('mode')
|
||||
->inject('events')
|
||||
->inject('deletes')
|
||||
->action(function (string $bucketId, string $fileId, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $events, Delete $deletes) {
|
||||
->action(function (string $bucketId, string $fileId, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $events) {
|
||||
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
|
@ -1325,11 +1323,6 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
$file = Authorization::skip(fn() => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file));
|
||||
}
|
||||
|
||||
$deletes
|
||||
->setType(DELETE_TYPE_CACHE_BY_RESOURCE)
|
||||
->setResource('file/' . $file->getId())
|
||||
;
|
||||
|
||||
$events
|
||||
->setParam('bucketId', $bucket->getId())
|
||||
->setParam('fileId', $file->getId())
|
||||
|
|
|
@ -168,8 +168,8 @@ class DeletesV1 extends Worker
|
|||
*/
|
||||
protected function deleteCacheByResource(Document $project, string $resource): void
|
||||
{
|
||||
$dbForProject = $this->getProjectDB($project);
|
||||
$projectId = $project->getId();
|
||||
$dbForProject = $this->getProjectDB($project);
|
||||
$document = $dbForProject->findOne('cache', [Query::equal('resource', [$resource])]);
|
||||
|
||||
if ($document) {
|
||||
|
@ -200,7 +200,6 @@ class DeletesV1 extends Worker
|
|||
protected function deleteCacheByDate(string $datetime): void
|
||||
{
|
||||
$this->deleteForProjectIds(function (Document $project) use ($datetime) {
|
||||
|
||||
$projectId = $project->getId();
|
||||
$dbForProject = $this->getProjectDB($project);
|
||||
$cache = new Cache(
|
||||
|
|
Loading…
Reference in a new issue