Skip to content

Commit 4f325f1

Browse files
authored
Build: healthcheck only on builds (#12418)
Skip healthcheck if the environment is initialized without a build. This is because we share the environment class with sync versions task as well.
1 parent 5c56de5 commit 4f325f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,9 @@ def create_container(self):
862862
)
863863
client.start(container=self.container_id)
864864

865-
if self.project.has_feature(Feature.BUILD_HEALTHCHECK):
865+
# NOTE: as this environment is used for `sync_repository_task` it may
866+
# not have a build associated. We skip running a healthcheck on those cases.
867+
if self.project.has_feature(Feature.BUILD_HEALTHCHECK) and self.build:
866868
self._run_background_healthcheck()
867869

868870
except (DockerAPIError, ConnectionError) as exc:

0 commit comments

Comments
 (0)