Fix functions + builds not deleted
This commit is contained in:
parent
d49de9c6cf
commit
004bb82688
2 changed files with 14 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue