mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
Fix race condition with screenshot worker updating dpeloyment
This commit is contained in:
parent
eec023aab3
commit
2a9f9f6851
1 changed files with 14 additions and 14 deletions
|
|
@ -913,17 +913,6 @@ class Builds extends Action
|
|||
Console::log('Build details stored');
|
||||
|
||||
$this->afterBuildSuccess($queueForRealtime, $dbForProject, $deployment, $runtime, $adapter);
|
||||
$logs = $deployment->getAttribute('buildLogs', '');
|
||||
|
||||
/** Screenshot site */
|
||||
if ($resource->getCollection() === 'sites') {
|
||||
$queueForScreenshots
|
||||
->setDeploymentId($deployment->getId())
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
|
||||
Console::log('Site screenshot queued');
|
||||
}
|
||||
|
||||
$logs = $deployment->getAttribute('buildLogs', '');
|
||||
$date = \date('H:i:s');
|
||||
|
|
@ -943,6 +932,16 @@ class Builds extends Action
|
|||
if ($isVcsEnabled) {
|
||||
$this->runGitAction('ready', $github, $providerCommitHash, $owner, $repositoryName, $project, $resource, $deployment->getId(), $dbForProject, $dbForPlatform, $queueForRealtime, $platform);
|
||||
}
|
||||
|
||||
/** Screenshot site */
|
||||
if ($resource->getCollection() === 'sites') {
|
||||
$queueForScreenshots
|
||||
->setDeploymentId($deployment->getId())
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
|
||||
Console::log('Site screenshot queued');
|
||||
}
|
||||
|
||||
/** Set auto deploy */
|
||||
$activateBuild = false;
|
||||
|
|
@ -1093,9 +1092,10 @@ class Builds extends Action
|
|||
|
||||
$endTime = DateTime::now();
|
||||
$durationEnd = \microtime(true);
|
||||
$deployment->setAttribute('buildEndedAt', $endTime);
|
||||
$deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart)));
|
||||
$deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment);
|
||||
$deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), new Document([
|
||||
'buildEndedAt' => $endTime,
|
||||
'buildDuration' => \intval(\ceil($durationEnd - $durationStart)),
|
||||
]));
|
||||
$queueForRealtime
|
||||
->setPayload($deployment->getArrayCopy())
|
||||
->trigger();
|
||||
|
|
|
|||
Loading…
Reference in a new issue