*: decrease frequency of background tasks, smear tasks based on name and fqdn

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

#2159
This commit is contained in:
Jens Langhammer
2022-04-20 18:42:56 +02:00
parent 1328c3e62c
commit 1a1434bfda
9 changed files with 37 additions and 17 deletions

View File

@ -1,25 +1,27 @@
"""Outposts Settings"""
from celery.schedules import crontab
from authentik.lib.utils.time import fqdn_rand
CELERY_BEAT_SCHEDULE = {
"outposts_controller": {
"task": "authentik.outposts.tasks.outpost_controller_all",
"schedule": crontab(minute="*/5"),
"schedule": crontab(minute=fqdn_rand("outposts_controller", 60), hour="*/4"),
"options": {"queue": "authentik_scheduled"},
},
"outposts_service_connection_check": {
"task": "authentik.outposts.tasks.outpost_service_connection_monitor",
"schedule": crontab(minute="*/5"),
"schedule": crontab(minute="3-59/15"),
"options": {"queue": "authentik_scheduled"},
},
"outpost_token_ensurer": {
"task": "authentik.outposts.tasks.outpost_token_ensurer",
"schedule": crontab(minute="*/5"),
"schedule": crontab(minute=fqdn_rand("outpost_token_ensurer", 60), hour="*/8"),
"options": {"queue": "authentik_scheduled"},
},
"outpost_local_connection": {
"task": "authentik.outposts.tasks.outpost_local_connection",
"schedule": crontab(minute="*/60"),
"schedule": crontab(minute=fqdn_rand("outpost_local_connection", 60), hour="*/8"),
"options": {"queue": "authentik_scheduled"},
},
}