root: add option to disable beat when running worker (#6849)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-09-12 13:26:23 +02:00 committed by GitHub
parent b4eb5be580
commit 515ce94a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,9 @@ LOGGER = get_logger()
class Command(BaseCommand): class Command(BaseCommand):
"""Run worker""" """Run worker"""
def add_arguments(self, parser):
parser.add_argument("-b", "--beat", action="store_true")
def handle(self, **options): def handle(self, **options):
close_old_connections() close_old_connections()
if CONFIG.get_bool("remote_debug"): if CONFIG.get_bool("remote_debug"):
@ -28,7 +31,7 @@ class Command(BaseCommand):
optimization="fair", optimization="fair",
autoscale=(3, 1), autoscale=(3, 1),
task_events=True, task_events=True,
beat=True, beat=options.get("beat", True),
schedule_filename=f"{tempdir}/celerybeat-schedule", schedule_filename=f"{tempdir}/celerybeat-schedule",
queues=["authentik", "authentik_scheduled", "authentik_events"], queues=["authentik", "authentik_scheduled", "authentik_events"],
) )