@@ -404,6 +404,7 @@ def process(self, forceCompute=False):
404404 global runningProcesses
405405 runningProcesses [self .name ] = self
406406 self ._status .initStartCompute ()
407+ exceptionStatus = None
407408 startTime = time .time ()
408409 self .upgradeStatusTo (Status .RUNNING )
409410 self .statThread = stats .StatisticsThread (self )
@@ -412,14 +413,16 @@ def process(self, forceCompute=False):
412413 self .node .nodeDesc .processChunk (self )
413414 except Exception as e :
414415 if self ._status .status != Status .STOPPED :
415- self . upgradeStatusTo ( Status .ERROR )
416+ exceptionStatus = Status .ERROR
416417 raise
417418 except (KeyboardInterrupt , SystemError , GeneratorExit ) as e :
418- self . upgradeStatusTo ( Status .STOPPED )
419+ exceptionStatus = Status .STOPPED
419420 raise
420421 finally :
421422 self ._status .initEndCompute ()
422423 self ._status .elapsedTime = time .time () - startTime
424+ if exceptionStatus is not None :
425+ self .upgradeStatusTo (exceptionStatus )
423426 logging .info (' - elapsed time: {}' .format (self ._status .elapsedTimeStr ))
424427 # ask and wait for the stats thread to stop
425428 self .statThread .stopRequest ()
@@ -805,6 +808,13 @@ def clearData(self):
805808 shutil .rmtree (self .internalFolder )
806809 self .updateStatusFromCache ()
807810
811+ @Slot (result = str )
812+ def getStartDateTime (self ):
813+ """ Return the date (str) of the first running chunk """
814+ dateTime = [chunk ._status .startDateTime for chunk in self ._chunks if chunk ._status .status
815+ not in (Status .NONE , Status .SUBMITTED ) and chunk ._status .startDateTime != "" ]
816+ return min (dateTime ) if len (dateTime ) != 0 else ""
817+
808818 def isAlreadySubmitted (self ):
809819 for chunk in self ._chunks :
810820 if chunk .isAlreadySubmitted ():
@@ -827,6 +837,11 @@ def isSubmittedOrRunning(self):
827837 return True
828838 return False
829839
840+ @Slot (result = bool )
841+ def isRunning (self ):
842+ """ Return True if at least one chunk of this Node is running, False otherwise. """
843+ return any (chunk .isRunning () for chunk in self ._chunks )
844+
830845 @Slot (result = bool )
831846 def isFinishedOrRunning (self ):
832847 """ Return True if all chunks of this Node is either finished or running, False otherwise. """
0 commit comments