We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc69f23 commit 43ad56fCopy full SHA for 43ad56f
readthedocs/projects/tasks/utils.py
@@ -120,7 +120,12 @@ def finish_unhealthy_builds():
120
"""
121
log.debug("Running task to finish inactive builds (no healtcheck received).")
122
delta = datetime.timedelta(seconds=settings.RTD_BUILD_HEALTHCHECK_TIMEOUT)
123
- query = ~Q(state__in=BUILD_FINAL_STATES) & Q(healthcheck__lt=timezone.now() - delta)
+ query = (
124
+ # Grab 3 days old at most to use a fast DB index
125
+ Q(date__gt=timezone.now() - datetime.timedelta(days=3))
126
+ & ~Q(state__in=BUILD_FINAL_STATES)
127
+ & Q(healthcheck__lt=timezone.now() - delta)
128
+ )
129
130
projects_finished = set()
131
builds_finished = []
0 commit comments