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()