1
0
Fork 0
mirror of synced 2024-07-03 21:50:34 +12:00

Merge branch 'feat-storage-buckets' of github.com:appwrite/appwrite into feat-storage-buckets

This commit is contained in:
Damodar Lohani 2021-11-07 11:38:12 +05:45
commit e8443ded49

View file

@ -53,6 +53,9 @@ class DeletesV1 extends Worker
case DELETE_TYPE_TEAMS:
$this->deleteMemberships($document, $projectId);
break;
case 'buckets':
$this->deleteBucket($document, $projectId);
break;
default:
Console::error('No lazy delete operation available for document of type: ' . $document->getCollection());
break;
@ -400,4 +403,16 @@ class DeletesV1 extends Worker
Console::info("No certificate files found for {$domain}");
}
}
protected function deleteBucket(Document $document, string $projectId)
{
$bucketId = $document->getId();
$this->deleteByGroup('files',[
new Query('bucketId', Query::TYPE_EQUAL, [$bucketId])
], $this->getInternalDB($projectId));
$device = new Local(APP_STORAGE_UPLOADS.'/app-'.$projectId);
$device->deletePath($device->getRoot() . DIRECTORY_SEPARATOR . $bucketId);
}
}