Skip to content

Commit 401b375

Browse files
authored
Build: auto-disable ACKS_LATE for long builds (#12393)
When a customer/user requests longer builds, we set `container_time_limit` at project level. However, if the time is longer than 1h we also need to add `BUILD_NO_ACKS_LATE` to that project. This PR checks for that limit and if it's longer than 1h adds `acks_late=False` to the build task. Related to #12369
1 parent 5b25fdb commit 401b375

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readthedocs/core/utils/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ def prepare_build(
161161
# At 1h exactly, the task is grabbed by another worker and re-executed,
162162
# even while it's still running on the original worker.
163163
# https://github.com/readthedocs/readthedocs.org/issues/12317
164-
if project.has_feature(Feature.BUILD_NO_ACKS_LATE):
164+
if (
165+
project.has_feature(Feature.BUILD_NO_ACKS_LATE)
166+
or project.container_time_limit
167+
and project.container_time_limit > settings.BUILD_TIME_LIMIT
168+
):
165169
log.info("Disabling ACKS_LATE for this particular build.")
166170
options["acks_late"] = False
167171

0 commit comments

Comments
 (0)