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 prometheus_client import Info
|
||||||
|
|
||||||
from authentik.blueprints.apps import ManagedAppConfig
|
from authentik.blueprints.apps import ManagedAppConfig
|
||||||
|
from authentik.lib.config import CONFIG
|
||||||
from authentik.lib.utils.time import fqdn_rand
|
from authentik.lib.utils.time import fqdn_rand
|
||||||
from authentik.tasks.schedules.lib import ScheduleSpec
|
from authentik.tasks.schedules.lib import ScheduleSpec
|
||||||
|
|
||||||
@ -41,5 +42,6 @@ class AuthentikAdminConfig(ManagedAppConfig):
|
|||||||
ScheduleSpec(
|
ScheduleSpec(
|
||||||
actor=update_latest_version,
|
actor=update_latest_version,
|
||||||
crontab=f"{fqdn_rand('admin_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,
|
actor=outpost_connection_discovery,
|
||||||
crontab=f"{fqdn_rand('outpost_connection_discovery')} */8 * * *",
|
crontab=f"{fqdn_rand('outpost_connection_discovery')} */8 * * *",
|
||||||
run_on_startup=True,
|
run_on_startup=True,
|
||||||
|
paused=not CONFIG.get_bool("outposts.discover"),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -13,6 +13,7 @@ if TYPE_CHECKING:
|
|||||||
class ScheduleSpec:
|
class ScheduleSpec:
|
||||||
actor: Actor
|
actor: Actor
|
||||||
crontab: str
|
crontab: str
|
||||||
|
paused: bool = False
|
||||||
uid: str | None = None
|
uid: str | None = None
|
||||||
|
|
||||||
args: Iterable[Any] = field(default_factory=tuple)
|
args: Iterable[Any] = field(default_factory=tuple)
|
||||||
@ -50,6 +51,7 @@ class ScheduleSpec:
|
|||||||
defaults = {
|
defaults = {
|
||||||
**query,
|
**query,
|
||||||
"actor_name": self.actor.actor_name,
|
"actor_name": self.actor.actor_name,
|
||||||
|
"paused": self.paused,
|
||||||
"args": self.get_args(),
|
"args": self.get_args(),
|
||||||
"kwargs": self.get_kwargs(),
|
"kwargs": self.get_kwargs(),
|
||||||
"options": self.get_options(),
|
"options": self.get_options(),
|
||||||
|
Reference in New Issue
Block a user