add certificates to deletion worker
This commit is contained in:
parent
fbc5994697
commit
9e9fb6414d
1 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue