Skip to content

Commit

Permalink
Load patches in static definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Michaud committed Oct 17, 2024
1 parent c496e9c commit b3de19f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/saturn_engine/worker_manager/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/saturn_engine/worker_manager/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit b3de19f

Please sign in to comment.