mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat: merge conflicts
This commit is contained in:
+8
-8
@@ -962,7 +962,7 @@ App::delete('/v1/functions/:functionId')
|
||||
->action(
|
||||
function (string $functionId, string $projectId, Response $response, Database $dbForProject) use ($orchestrationPool) {
|
||||
|
||||
$results = $dbForProject->find('deployments', [new Query('functionId', Query::TYPE_EQUAL, [$functionId])], 999);
|
||||
$results = $dbForProject->find('deployments', [new Query('resourceId', Query::TYPE_EQUAL, [$functionId])], 999);
|
||||
|
||||
// If amount is 0 then we simply return true
|
||||
if (count($results) === 0) {
|
||||
@@ -975,19 +975,19 @@ App::delete('/v1/functions/:functionId')
|
||||
global $register;
|
||||
foreach ($results as $deployment) {
|
||||
go(function () use ($orchestrationPool, $deployment, $register, $projectId) {
|
||||
$db = $register->get('dbPool')->get();
|
||||
$redis = $register->get('redisPool')->get();
|
||||
$cache = new Cache(new RedisCache($redis));
|
||||
$dbForProject = new Database(new MariaDB($db), $cache);
|
||||
$dbForProject->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
|
||||
$dbForProject->setNamespace('_project_' . $projectId);
|
||||
|
||||
try {
|
||||
$orchestration = $orchestrationPool->get();
|
||||
// Remove the container of the deployment
|
||||
$orchestration->remove('appwrite-function-' . $deployment['$id'], true);
|
||||
Console::success('Removed container for deployment: ' . $deployment['$id']);
|
||||
|
||||
$db = $register->get('dbPool')->get();
|
||||
$redis = $register->get('redisPool')->get();
|
||||
$cache = new Cache(new RedisCache($redis));
|
||||
$dbForProject = new Database(new MariaDB($db), $cache);
|
||||
$dbForProject->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
|
||||
$dbForProject->setNamespace('_project_' . $projectId);
|
||||
|
||||
$builds = $dbForProject->find('builds', [
|
||||
new Query('deploymentId', Query::TYPE_EQUAL, [$deployment['$id']]),
|
||||
new Query('status', Query::TYPE_EQUAL, ['building'])
|
||||
|
||||
@@ -348,7 +348,7 @@ class DeletesV1 extends Worker
|
||||
$storageFunctions = new Local(APP_STORAGE_FUNCTIONS . '/app-' . $projectId);
|
||||
$deploymentIds = [];
|
||||
$this->deleteByGroup('deployments', [
|
||||
new Query('functionId', Query::TYPE_EQUAL, [$document->getId()])
|
||||
new Query('resourceId', Query::TYPE_EQUAL, [$document->getId()])
|
||||
], $dbForProject, function (Document $document) use ($storageFunctions, &$deploymentIds) {
|
||||
$deploymentIds[] = $document->getId();
|
||||
if ($storageFunctions->delete($document->getAttribute('path', ''), true)) {
|
||||
|
||||
Reference in New Issue
Block a user