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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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')