diff --git a/lib/galaxy/jobs/runners/__init__.py b/lib/galaxy/jobs/runners/__init__.py index c14aea726f03..1be761b9b9ce 100644 --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -33,7 +33,10 @@ job_script, write_script, ) -from galaxy.model.base import transaction +from galaxy.model.base import ( + check_database_connection, + transaction, +) from galaxy.tool_util.deps.dependencies import ( JobInfo, ToolInfo, @@ -829,6 +832,7 @@ def monitor(self): pass # Iterate over the list of watched jobs and check state try: + check_database_connection(self.sa_session) self.check_watched_items() except Exception: log.exception("Unhandled exception checking active jobs") diff --git a/lib/galaxy/jobs/runners/pulsar.py b/lib/galaxy/jobs/runners/pulsar.py index 3925f4d8a7be..a554a4b54775 100644 --- a/lib/galaxy/jobs/runners/pulsar.py +++ b/lib/galaxy/jobs/runners/pulsar.py @@ -274,7 +274,6 @@ def url_to_destination(self, url): return JobDestination(runner="pulsar", params=url_to_destination_params(url)) def check_watched_item(self, job_state): - check_database_connection(self.app.model.session()) if self.use_mq: # Might still need to check pod IPs. job_wrapper = job_state.job_wrapper