Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-04-07 14:39:25 +02:00
parent a43a0f77fb
commit 2139e0be05
4 changed files with 13 additions and 8 deletions

View File

@ -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]:

View File

@ -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)

View File

@ -5,5 +5,5 @@ from dramatiq import actor
def test_actor():
import time
time.sleep(5)
time.sleep(2)
print("done sleeping")

View File

@ -43,9 +43,9 @@ export class ScheduleList extends Table<Schedule> {
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")),
];
}