Skip to content

Commit 9a5b58b

Browse files
committed
Time limit in task
1 parent 5908201 commit 9a5b58b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

readthedocs/projects/tasks/utils.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,13 @@ def finish_inactive_builds():
162162
163163
A build is consider inactive if it's not in a final state and it has been
164164
"running" for more time that the allowed one (``Project.container_time_limit``
165-
or ``DOCKER_LIMITS['time']`` plus a 20% of it).
165+
or ``BUILD_TIME_LIMIT`` plus a 20% of it).
166166
167167
These inactive builds will be marked as ``success`` and ``CANCELLED`` with an
168168
``error`` to be communicated to the user.
169169
"""
170170
# TODO: delete this task once we are fully migrated to ``BUILD_HEALTHCHECK``
171-
#
172-
# TODO similar to the celery task time limit, we can't infer this from
173-
# Docker settings anymore, because Docker settings are determined on the
174-
# build servers dynamically.
175-
# time_limit = int(DOCKER_LIMITS['time'] * 1.2)
176-
# Set time as maximum celery task time limit + 5m
177-
time_limit = 7200 + 300
171+
time_limit = settings.BUILD_TIME_LIMIT * 1.2
178172
delta = datetime.timedelta(seconds=time_limit)
179173
query = (
180174
~Q(state__in=BUILD_FINAL_STATES)

0 commit comments

Comments
 (0)