diff --git a/src/saturn_engine/worker_manager/api/jobs.py b/src/saturn_engine/worker_manager/api/jobs.py index dd3d4fd2..b46c96e9 100644 --- a/src/saturn_engine/worker_manager/api/jobs.py +++ b/src/saturn_engine/worker_manager/api/jobs.py @@ -67,6 +67,8 @@ def update_job(job_name: str) -> Json[UpdateResponse]: def post_sync() -> Json[JobsSyncResponse]: """Create jobs that are due to be scheduled.""" with session_scope() as session: + # We reset static definition at each jobs sync + current_app.saturn.load_static_definition(session=session) sync_jobs( static_definitions=current_app.saturn.static_definitions, session=session, diff --git a/src/saturn_engine/worker_manager/context.py b/src/saturn_engine/worker_manager/context.py index 07710554..776b1470 100644 --- a/src/saturn_engine/worker_manager/context.py +++ b/src/saturn_engine/worker_manager/context.py @@ -23,6 +23,8 @@ def static_definitions(self) -> StaticDefinitions: return self._static_definitions def load_static_definition(self, session: AnySession) -> None: + if not self.config.static_definitions_jobs_selector: + return None self._static_definitions = _load_static_definition( session=session, config=self.config )