diff --git a/capsul/config/configuration.py b/capsul/config/configuration.py index c00eb520..46d781a3 100644 --- a/capsul/config/configuration.py +++ b/capsul/config/configuration.py @@ -156,7 +156,7 @@ class EngineConfiguration(Controller): python_modules: list[str] database: str = "builtin" - persistent: bool + persistent: bool = True start_workers: field( type_=dict, default_factory=lambda: default_engine_start_workers diff --git a/capsul/database/populse_db.py b/capsul/database/populse_db.py index f4d631aa..fef69692 100644 --- a/capsul/database/populse_db.py +++ b/capsul/database/populse_db.py @@ -129,7 +129,7 @@ def get_or_create_engine(self, engine, update_database=False): if persistent is undefined: persistent = db.tmp.get() is None if row: - engine_id = row[0] + engine_id = row[0][0] if update_database: # Update configuration stored in database db.capsul_engine[engine_id].update( @@ -219,7 +219,6 @@ def dispose_engine(self, engine_id): if row: connections, persistent, executions = row connections -= 1 - db.capsul_engine[engine_id].label = None if connections == 0 and not persistent: # Check if some executions had not been disposed erase = True @@ -260,7 +259,6 @@ def executions_summary(self, engine_id): "done", "failed", ], - as_list=True, ) if info: for i in ("waiting", "ready", "ongoing", "done", "failed"): @@ -329,7 +327,11 @@ def pop_job_json(self, engine_id, start_time): if not os.path.exists(self.path): return None, None with self.storage.data(write=True) as db: - executions = db.capsul_engine[engine_id].executions.get() + if db is None: + # database doesn't exist anymore + executions = None + else: + executions = db.capsul_engine[engine_id].executions.get() if executions is None: # engine_id does not exist anymore # return None to say to workers that they can die