mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Fix builds worker trying to update documents that don't exist
This commit is contained in:
parent
c30b5b1a77
commit
0639ac1ab3
1 changed files with 6 additions and 0 deletions
|
|
@ -391,6 +391,12 @@ class BuildsV1 extends Worker
|
|||
projectId: $project->getId(),
|
||||
callback: function ($logs) use (&$response, &$build, $dbForProject, $allEvents, $project) {
|
||||
if ($response === null) {
|
||||
$build = $dbForProject->getDocument('builds', $build->getId());
|
||||
|
||||
if ($build->isEmpty()) {
|
||||
throw new Exception('Build not found', 404);
|
||||
}
|
||||
|
||||
$build = $build->setAttribute('logs', $build->getAttribute('logs', '') . $logs);
|
||||
$build = $dbForProject->updateDocument('builds', $build->getId(), $build);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue