diff --git a/backend/onyx/background/celery/tasks/beat_schedule.py b/backend/onyx/background/celery/tasks/beat_schedule.py index d00ceefcf7d..c3e339531d6 100644 --- a/backend/onyx/background/celery/tasks/beat_schedule.py +++ b/backend/onyx/background/celery/tasks/beat_schedule.py @@ -4,6 +4,8 @@ from onyx.configs.constants import OnyxCeleryPriority from onyx.configs.constants import OnyxCeleryTask +BEAT_EXPIRES_DEFAULT = 30 * 60 # 30 minutes + # we set expires because it isn't necessary to queue up these tasks # it's only important that they run relatively regularly tasks_to_schedule = [ @@ -13,7 +15,7 @@ "schedule": timedelta(seconds=20), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -22,7 +24,7 @@ "schedule": timedelta(seconds=20), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -31,7 +33,7 @@ "schedule": timedelta(seconds=15), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -40,7 +42,7 @@ "schedule": timedelta(seconds=15), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -49,7 +51,7 @@ "schedule": timedelta(seconds=3600), "options": { "priority": OnyxCeleryPriority.LOWEST, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -58,7 +60,7 @@ "schedule": timedelta(seconds=5), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -67,7 +69,7 @@ "schedule": timedelta(seconds=30), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, { @@ -76,7 +78,7 @@ "schedule": timedelta(seconds=20), "options": { "priority": OnyxCeleryPriority.HIGH, - "expires": 60, + "expires": BEAT_EXPIRES_DEFAULT, }, }, ]