1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

Fix functions + builds not deleted

This commit is contained in:
Jake Barnby 2023-01-12 22:42:07 +13:00
parent d49de9c6cf
commit 004bb82688
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 14 additions and 3 deletions

View file

@ -253,8 +253,10 @@ class DeletesV1 extends Worker
*/
protected function deleteProject(Document $document): void
{
$projectId = $document->getId();
// Delete project tables
$dbForProject = $this->getProjectDB($document->getId(), $document);
$dbForProject = $this->getProjectDB($projectId, $document);
$limit = 50;
$offset = 0;
@ -282,10 +284,14 @@ class DeletesV1 extends Worker
}
// Delete all storage directories
$uploads = $this->getFilesDevice($document->getId());
$cache = new Local(APP_STORAGE_CACHE . '/app-' . $document->getId());
$uploads = $this->getFilesDevice($projectId);
$functions = $this->getFunctionsDevice($projectId);
$builds = $this->getBuildsDevice($projectId);
$cache = $this->getCacheDevice($projectId);
$uploads->delete($uploads->getRoot(), true);
$functions->delete($functions->getRoot(), true);
$builds->delete($builds->getRoot(), true);
$cache->delete($cache->getRoot(), true);
}

View file

@ -296,6 +296,11 @@ abstract class Worker
return $this->getDevice(APP_STORAGE_BUILDS . '/app-' . $projectId);
}
protected function getCacheDevice(string $projectId): Device
{
return $this->getDevice(APP_STORAGE_CACHE . '/app-' . $projectId);
}
/**
* Get Device based on selected storage environment
* @param string $root path of the device