Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend sync_user_details expiry #5330

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion redash/tasks/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ 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": sync_user_details,
"timeout": 60,
"interval": timedelta(minutes=1),
"result_ttl": 600,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we don't choose unlimited ttl by not setting result_ttl which is also recommended by rq-scheduler doc?

According to rq-scheduler's doc :

IMPORTANT NOTE: If you set up a repeated job, you must make sure that you either do not set a result_ttl value or you set a value larger than the interval. Otherwise, the entry with the job details will expire and the job will not get re-scheduled.

result_ttl will be set to -1 if not provided (rq scheduler code reference)

More explicitly, rq scheduler set result_ttl as -1 for cron job (rq scheduler code reference)

},
{"func": purge_failed_jobs, "timeout": 3600, "interval": timedelta(days=1)},
{
"func": send_aggregated_errors,
Expand Down