Merge branch 'feat-functions-refactor' of github.com:appwrite/appwrite into feat-add-builds-worker

This commit is contained in:
Christy Jacob
2022-01-26 16:59:24 +04:00
46 changed files with 694 additions and 686 deletions
+4 -4
View File
@@ -309,15 +309,15 @@ class DeletesV1 extends Worker
$dbForProject = $this->getProjectDB($projectId);
$device = new Local(APP_STORAGE_FUNCTIONS . '/app-' . $projectId);
// Delete Tags
$this->deleteByGroup('tags', [
// Delete Deployments
$this->deleteByGroup('deployments', [
new Query('functionId', Query::TYPE_EQUAL, [$document->getId()])
], $dbForProject, function (Document $document) use ($device) {
if ($device->delete($document->getAttribute('path', ''))) {
Console::success('Delete code tag: ' . $document->getAttribute('path', ''));
Console::success('Delete code deployment: ' . $document->getAttribute('path', ''));
} else {
Console::error('Failed to delete code tag: ' . $document->getAttribute('path', ''));
Console::error('Failed to delete code deployment: ' . $document->getAttribute('path', ''));
}
});
+3 -3
View File
@@ -84,11 +84,11 @@ class FunctionsV1 extends Worker
foreach ($functions as $function) {
$events = $function->getAttribute('events', []);
$tag = $function->getAttribute('tag', []);
$deployment = $function->getAttribute('deployment', []);
Console::success('Itterating function: ' . $function->getAttribute('name'));
if (!\in_array($event, $events) || empty($tag)) {
if (!\in_array($event, $events) || empty($deployment)) {
continue;
}
@@ -205,7 +205,7 @@ class FunctionsV1 extends Worker
}
/**
* Execute function tag
* Execute function deployment
*
* @param string $trigger
* @param string $projectId