Commits

Ronny Pfannschmidt committed ddd91e8

remember step finalization time

  • Participants
  • Parent commits 115f17a

Comments (0)

Files changed (1)

File glas_process/baseproc.py

+from datetitme import datetime
+
 import gevent
 from gevent.queue import Queue
+
 from juggler.model import Step, Event
 
 
             self.save_with_batch(doc)
             returncode = getattr(doc, 'returncode', None)
             if returncode is not None and self.step is not None:
-                status = 'complete' if returncode == 0 else 'failed'
-                self.step.status = status
-                self.save_step()
+                
+                self.finish_step('complete' if returncode == 0 else 'failed')
+
+    def finish_step(self, newstate):
+        self.step.status = newstate
+        self.step.finished = datetime.now()
+        self.save_step()
 
     def start(self):
         if self._control is None: