pause schedules by default if needed
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
@ -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"),
|
||||
),
|
||||
]
|
||||
|
@ -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"),
|
||||
),
|
||||
]
|
||||
|
@ -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(),
|
||||
|
Reference in New Issue
Block a user