Skip to content

Commit

Permalink
Fix broken function call
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Michaud authored and infherny committed Oct 16, 2024
1 parent ac54a57 commit 25df169
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/saturn_engine/worker/worker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(

self.context = WorkerManagerContext(config=config.c.worker_manager)
with self.sessionmaker() as session:
self.context.reset_static_definition(session=session)
self.context.load_static_definition(session=session)

async def init_db(self) -> None:
return await asyncio.get_event_loop().run_in_executor(
Expand Down
5 changes: 2 additions & 3 deletions src/saturn_engine/worker_manager/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def __init__(self, config: WorkerManagerConfig) -> None:

@property
def static_definitions(self) -> StaticDefinitions:
assert (
self._static_definitions
), "Static definitions need to be set before usage"
if not self._static_definitions:
raise ValueError("Static definitions need to be set before usage")
return self._static_definitions

def load_static_definition(self, session: AnySession) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/saturn_engine/worker_manager/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def init_all(app: Optional[SaturnApp] = None) -> None:
with app.app_context():
create_all()
with session_scope() as session:
current_app.saturn.reset_static_definition(session=session)
current_app.saturn.load_static_definition(session=session)
sync_jobs(
static_definitions=current_app.saturn.static_definitions,
session=session,
Expand Down

0 comments on commit 25df169

Please sign in to comment.