Skip to content

Commit

Permalink
purge_failed_jobs can take up to several minutes, so better have a pr…
Browse files Browse the repository at this point in the history
…oper timeout (#5033)
  • Loading branch information
Omer Lachish authored Jul 12, 2020
1 parent 87e09f6 commit ecb9adf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions redash/tasks/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
purge_failed_jobs,
version_check,
send_aggregated_errors,
Queue
Queue,
)

logger = logging.getLogger(__name__)
Expand All @@ -27,6 +27,7 @@ class StatsdRecordingScheduler(Scheduler):
"""
RQ Scheduler Mixin that uses Redash's custom RQ Queue class to increment/modify metrics via Statsd
"""

queue_class = Queue


Expand Down Expand Up @@ -65,12 +66,8 @@ def periodic_job_definitions():
"func": refresh_schemas,
"interval": timedelta(minutes=settings.SCHEMAS_REFRESH_SCHEDULE),
},
{
"func": sync_user_details,
"timeout": 60,
"interval": timedelta(minutes=1),
},
{"func": purge_failed_jobs, "interval": timedelta(days=1)},
{"func": sync_user_details, "timeout": 60, "interval": timedelta(minutes=1),},
{"func": purge_failed_jobs, "timeout": 3600, "interval": timedelta(days=1)},
{
"func": send_aggregated_errors,
"interval": timedelta(minutes=settings.SEND_FAILURE_EMAIL_INTERVAL),
Expand Down

0 comments on commit ecb9adf

Please sign in to comment.