diff --git a/lib/galaxy/workflow/scheduling_manager.py b/lib/galaxy/workflow/scheduling_manager.py index e28b04a7ea86..233decaa89b7 100644 --- a/lib/galaxy/workflow/scheduling_manager.py +++ b/lib/galaxy/workflow/scheduling_manager.py @@ -16,6 +16,7 @@ from galaxy import model from galaxy.exceptions import HandlerAssignmentError from galaxy.jobs.handler import InvocationGrabber +from galaxy.model.base import check_database_connection from galaxy.schema.invocation import ( FailureReason, InvocationFailureDatasetFailed, @@ -431,6 +432,7 @@ def __attempt_materialize(self, workflow_invocation: model.WorkflowInvocation, s def __attempt_schedule(self, invocation_id, workflow_scheduler): with self.app.model.context() as session: + check_database_connection(session) workflow_invocation = session.get(model.WorkflowInvocation, invocation_id) if workflow_invocation.state == workflow_invocation.states.REQUIRES_MATERIALIZATION: if not self.__attempt_materialize(workflow_invocation, session):