mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
Merge pull request #9660 from appwrite/fix-deployment-deletion
Fix deployment and executions deletion
This commit is contained in:
commit
f1ff8dd783
1 changed files with 17 additions and 2 deletions
|
|
@ -885,7 +885,9 @@ class Deletes extends Action
|
|||
$deploymentInternalIds = [];
|
||||
$deploymentIds = [];
|
||||
$this->deleteByGroup('deployments', [
|
||||
Query::equal('resourceInternalId', [$siteInternalId])
|
||||
Query::equal('resourceInternalId', [$siteInternalId]),
|
||||
Query::equal('resourceType', ['site']),
|
||||
Query::orderAsc()
|
||||
], $dbForProject, function (Document $document) use ($project, $certificates, $deviceForSites, $deviceForBuilds, $deviceForFiles, $dbForPlatform, &$deploymentInternalIds) {
|
||||
$deploymentInternalIds[] = $document->getInternalId();
|
||||
$deploymentIds[] = $document->getId();
|
||||
|
|
@ -894,6 +896,17 @@ class Deletes extends Action
|
|||
$this->deleteDeploymentScreenshots($deviceForFiles, $dbForPlatform, $document);
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete Logs
|
||||
*/
|
||||
Console::info("Deleting logs for site " . $siteId);
|
||||
$this->deleteByGroup('executions', [
|
||||
Query::select($this->selects),
|
||||
Query::equal('resourceInternalId', [$siteInternalId]),
|
||||
Query::equal('resourceType', ['sites']),
|
||||
Query::orderAsc()
|
||||
], $dbForProject);
|
||||
|
||||
/**
|
||||
* Delete VCS Repositories and VCS Comments
|
||||
*/
|
||||
|
|
@ -961,6 +974,7 @@ class Deletes extends Action
|
|||
$deploymentInternalIds = [];
|
||||
$this->deleteByGroup('deployments', [
|
||||
Query::equal('resourceInternalId', [$functionInternalId]),
|
||||
Query::equal('resourceType', ['function']),
|
||||
Query::orderAsc()
|
||||
], $dbForProject, function (Document $document) use ($dbForPlatform, $project, $certificates, $deviceForFunctions, $deviceForBuilds, &$deploymentInternalIds) {
|
||||
$deploymentInternalIds[] = $document->getInternalId();
|
||||
|
|
@ -974,7 +988,8 @@ class Deletes extends Action
|
|||
Console::info("Deleting executions for function " . $functionId);
|
||||
$this->deleteByGroup('executions', [
|
||||
Query::select($this->selects),
|
||||
Query::equal('functionInternalId', [$functionInternalId]),
|
||||
Query::equal('resourceInternalId', [$functionInternalId]),
|
||||
Query::equal('resourceType', ['functions']),
|
||||
Query::orderAsc()
|
||||
], $dbForProject);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue