diff --git a/authentik/outposts/apps.py b/authentik/outposts/apps.py index 8f9be7c4aa..3974a143a0 100644 --- a/authentik/outposts/apps.py +++ b/authentik/outposts/apps.py @@ -65,9 +65,12 @@ class AuthentikOutpostConfig(ManagedAppConfig): @ManagedAppConfig.reconcile_global def outpost_connection_discovery(self): - from authentik.outposts.tasks import outpost_connection_discovery + from authentik.tasks.schedules.models import Schedule - outpost_connection_discovery.send() + for schedule in Schedule.objects.filter( + actor_name__in=("authentik.outposts.tasks.outpost_connection_discovery",), + ): + schedule.send() @property def tenant_schedule_specs(self) -> list[ScheduleSpec]: diff --git a/authentik/outposts/tasks.py b/authentik/outposts/tasks.py index b4da611feb..6010e90388 100644 --- a/authentik/outposts/tasks.py +++ b/authentik/outposts/tasks.py @@ -163,7 +163,8 @@ def outpost_post_save(model_class: str, model_pk: Any): if isinstance(instance, Outpost): LOGGER.debug("Trigger reconcile for outpost", instance=instance) - outpost_controller.send(instance.pk) + for schedule in instance.schedules.all(): + schedule.send() if isinstance(instance, OutpostModel | Outpost): LOGGER.debug("triggering outpost update from outpostmodel/outpost", instance=instance) @@ -171,7 +172,8 @@ def outpost_post_save(model_class: str, model_pk: Any): if isinstance(instance, OutpostServiceConnection): LOGGER.debug("triggering ServiceConnection state update", instance=instance) - outpost_service_connection_monitor.send(instance.pk) + for schedule in instance.schedules.all(): + schedule.send() for field in instance._meta.get_fields(): # Each field is checked if it has a `related_model` attribute (when ForeginKeys or M2Ms) diff --git a/authentik/tasks/tasks.py b/authentik/tasks/tasks.py index 9b2896b426..9358b65c3b 100644 --- a/authentik/tasks/tasks.py +++ b/authentik/tasks/tasks.py @@ -5,5 +5,5 @@ from dramatiq import actor def test_actor(): import time - time.sleep(5) + time.sleep(2) print("done sleeping") diff --git a/web/src/admin/system-tasks/ScheduleList.ts b/web/src/admin/system-tasks/ScheduleList.ts index 4c629da8f5..fa996ece25 100644 --- a/web/src/admin/system-tasks/ScheduleList.ts +++ b/web/src/admin/system-tasks/ScheduleList.ts @@ -43,9 +43,9 @@ export class ScheduleList extends Table { columns(): TableColumn[] { return [ - new TableColumn(msg("Schedule")), - new TableColumn(msg("Crontab")), - new TableColumn(msg("Next run")), + new TableColumn(msg("Schedule"), "actor_name"), + new TableColumn(msg("Crontab"), "crontab"), + new TableColumn(msg("Next run"), "next_run"), new TableColumn(msg("Actions")), ]; }