mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
add certificates to deletion worker
This commit is contained in:
@@ -52,6 +52,9 @@ class DeletesV1
|
||||
case Database::SYSTEM_COLLECTION_COLLECTIONS:
|
||||
$this->deleteDocuments($document, $projectId);
|
||||
break;
|
||||
case Database::SYSTEM_COLLECTION_DOMAINS:
|
||||
$this->deleteCertificates($document);
|
||||
break;
|
||||
default:
|
||||
Console::error('No lazy delete operation available for document of type: '.$document->getCollection());
|
||||
break;
|
||||
@@ -305,6 +308,18 @@ class DeletesV1
|
||||
Console::info("Deleted {$count} document by group in " . ($executionEnd - $executionStart) . " seconds");
|
||||
}
|
||||
|
||||
protected function deleteCertificates(Document $document)
|
||||
{
|
||||
$domain = $document->getAttribute('domain', null);
|
||||
$directory = APP_STORAGE_CERTIFICATES . '/' . $domain;
|
||||
|
||||
if($domain && is_dir($directory)) {
|
||||
array_map('unlink', glob("$directory/*.*"));
|
||||
rmdir($directory);
|
||||
Console::info("Deleted certificate files for domain {$domain}");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Database;
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user