Merge branch 'feat-storage-buckets' of github.com:appwrite/appwrite into feat-storage-buckets
This commit is contained in:
commit
e8443ded49
1 changed files with 15 additions and 0 deletions
|
@ -53,6 +53,9 @@ class DeletesV1 extends Worker
|
||||||
case DELETE_TYPE_TEAMS:
|
case DELETE_TYPE_TEAMS:
|
||||||
$this->deleteMemberships($document, $projectId);
|
$this->deleteMemberships($document, $projectId);
|
||||||
break;
|
break;
|
||||||
|
case 'buckets':
|
||||||
|
$this->deleteBucket($document, $projectId);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Console::error('No lazy delete operation available for document of type: ' . $document->getCollection());
|
Console::error('No lazy delete operation available for document of type: ' . $document->getCollection());
|
||||||
break;
|
break;
|
||||||
|
@ -400,4 +403,16 @@ class DeletesV1 extends Worker
|
||||||
Console::info("No certificate files found for {$domain}");
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue