From 22575f0e35d1b91acbbd068f91ef6a3b6ba0b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 20 Nov 2021 15:19:01 +0100 Subject: [PATCH] Do not start builds after initialization success. Since they start quickly it is better to let users start them when needed, to avoid stopping builds that are actually used in favor of new builds they may not be needed by users. --- src/runboat/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runboat/models.py b/src/runboat/models.py index 5a73fbb..626290d 100644 --- a/src/runboat/models.py +++ b/src/runboat/models.py @@ -289,11 +289,11 @@ class Build(BaseModel): async def on_initialize_succeeded(self) -> None: if self.init_status == BuildInitStatus.succeeded: - # Avoid restarting stopped deployments when the controller is notified of - # succeeded old initialization jobs after a controller restart. + # Already marked as succeeded. We are probably here because the controller + # is restarting, and is notified of existing initialization jobs. return - _logger.info(f"Initialization job succeded for {self}, starting.") - if await self._patch(init_status=BuildInitStatus.succeeded, desired_replicas=1): + _logger.info(f"Initialization job succeded for {self}, ready to start.") + if await self._patch(init_status=BuildInitStatus.succeeded): await github.notify_status( self.repo, self.git_commit,