Loading ccserver/jobs.py +4 −5 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ class BaseJob(dict, Thread, object): raise JobError('Job is done') if self['cancelled']: raise JobError('Job is already cancelled') self['cancelled'] = True self.report('cancelling') Loading @@ -168,17 +169,15 @@ class BaseJob(dict, Thread, object): if key.startswith('_') or (props is not None and key not in props): continue if isinstance(val, datetime): now = datetime.now() dt = now - val val = dt.seconds + dt.days * 86400 val = int(time.mktime(val.timetuple())) if key == 'duration': if self['done']: dt = self['ended'] - self['started'] dt = self['ended'] - self['created'] val = dt.seconds + dt.days * 86400 else: now = datetime.now() dt = now - self['started'] dt = now - self['created'] val = dt.seconds + dt.days * 86400 exported[key] = str(val) Loading Loading
ccserver/jobs.py +4 −5 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ class BaseJob(dict, Thread, object): raise JobError('Job is done') if self['cancelled']: raise JobError('Job is already cancelled') self['cancelled'] = True self.report('cancelling') Loading @@ -168,17 +169,15 @@ class BaseJob(dict, Thread, object): if key.startswith('_') or (props is not None and key not in props): continue if isinstance(val, datetime): now = datetime.now() dt = now - val val = dt.seconds + dt.days * 86400 val = int(time.mktime(val.timetuple())) if key == 'duration': if self['done']: dt = self['ended'] - self['started'] dt = self['ended'] - self['created'] val = dt.seconds + dt.days * 86400 else: now = datetime.now() dt = now - self['started'] dt = now - self['created'] val = dt.seconds + dt.days * 86400 exported[key] = str(val) Loading