From d2f3ee46f4bd6250584f9ec70e7d279d9770fe9f Mon Sep 17 00:00:00 2001 From: Ilya Sytchev Date: Sat, 28 Jun 2014 17:57:06 -0400 Subject: [PATCH] Enable stopping jobs when history is deleted via the API. --- lib/galaxy/webapps/galaxy/api/histories.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/api/histories.py b/lib/galaxy/webapps/galaxy/api/histories.py index cd4600b7adb..e2bbdbc6bb6 100644 --- a/lib/galaxy/webapps/galaxy/api/histories.py +++ b/lib/galaxy/webapps/galaxy/api/histories.py @@ -235,6 +235,10 @@ class HistoriesController( BaseAPIController, UsesHistoryMixin, UsesTagsMixin, for hda in history.datasets: if hda.purged: continue + if hda.creating_job_associations: + job = hda.creating_job_associations[0].job + job.mark_deleted( self.app.config.track_jobs_in_database ) + self.app.job_manager.job_stop_queue.put( job.id ) hda.purged = True trans.sa_session.add( hda ) trans.sa_session.flush()