pause schedules by default if needed

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-06-12 15:44:42 +02:00
parent 196b276345
commit 7ed711e8f0
3 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@
from prometheus_client import Info
from authentik.blueprints.apps import ManagedAppConfig
from authentik.lib.config import CONFIG
from authentik.lib.utils.time import fqdn_rand
from authentik.tasks.schedules.lib import ScheduleSpec
@ -41,5 +42,6 @@ class AuthentikAdminConfig(ManagedAppConfig):
ScheduleSpec(
actor=update_latest_version,
crontab=f"{fqdn_rand('admin_latest_version')} * * * *",
paused=CONFIG.get_bool("disable_update_check"),
),
]

View File

@ -83,5 +83,6 @@ class AuthentikOutpostConfig(ManagedAppConfig):
actor=outpost_connection_discovery,
crontab=f"{fqdn_rand('outpost_connection_discovery')} */8 * * *",
run_on_startup=True,
paused=not CONFIG.get_bool("outposts.discover"),
),
]

View File

@ -13,6 +13,7 @@ if TYPE_CHECKING:
class ScheduleSpec:
actor: Actor
crontab: str
paused: bool = False
uid: str | None = None
args: Iterable[Any] = field(default_factory=tuple)
@ -50,6 +51,7 @@ class ScheduleSpec:
defaults = {
**query,
"actor_name": self.actor.actor_name,
"paused": self.paused,
"args": self.get_args(),
"kwargs": self.get_kwargs(),
"options": self.get_options(),