Skip to content
Snippets Groups Projects
Commit 6b0eade1 authored by Antoine Millet's avatar Antoine Millet
Browse files

Check if job is not already done or cancelled when calling cancel method.

parent 1e2d3745
No related branches found
No related tags found
No related merge requests found
......@@ -151,6 +151,10 @@ class BaseJob(dict, Thread, object):
the job.
'''
if self['done']:
raise JobError('Job is done')
if self['cancelled']:
raise JobError('Job is already cancelled')
self['cancelled'] = True
self.report('cancelling')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment