@@ -410,11 +410,12 @@ def process(self, forceCompute=False):
410410 try :
411411 self .node .nodeDesc .processChunk (self )
412412 except Exception as e :
413+ self ._status .elapsedTime = time .time () - startTime
413414 if self ._status .status != Status .STOPPED :
414- self ._status .elapsedTime = time .time () - startTime
415415 self .upgradeStatusTo (Status .ERROR )
416416 raise
417417 except (KeyboardInterrupt , SystemError , GeneratorExit ) as e :
418+ self ._status .elapsedTime = time .time () - startTime
418419 self .upgradeStatusTo (Status .STOPPED )
419420 raise
420421 finally :
@@ -802,6 +803,14 @@ def clearData(self):
802803 shutil .rmtree (self .internalFolder )
803804 self .updateStatusFromCache ()
804805
806+ @Slot (result = str )
807+ def getStartDateTime (self ):
808+ """ Return the date (str) of the first running chunk """
809+ if not self .isAlreadySubmittedOrFinished () or len (self ._chunks ) == 0 :
810+ return ""
811+ dateTime = [chunk ._status .startDateTime for chunk in self ._chunks if chunk ._status .startDateTime != "" ]
812+ return min (dateTime ) if len (dateTime ) != 0 else ""
813+
805814 def isAlreadySubmitted (self ):
806815 for chunk in self ._chunks :
807816 if chunk .isAlreadySubmitted ():
@@ -824,13 +833,10 @@ def isSubmittedOrRunning(self):
824833 return True
825834 return False
826835
827- @Slot (result = str )
828- def getFirstChunkRunning (self ):
829- """ Return the date (str) of the first running chunk """
830- if not self .isAlreadySubmittedOrFinished () or len (self ._chunks ) == 0 :
831- return ""
832- dateTime = [chunk ._status .startDateTime for chunk in self ._chunks if chunk ._status .startDateTime != "" ]
833- return min (dateTime ) if len (dateTime ) != 0 else ""
836+ @Slot (result = bool )
837+ def isRunning (self ):
838+ """ Return True if at least one chunk of this Node is running, False otherwise. """
839+ return any (chunk .isRunning () for chunk in self ._chunks )
834840
835841 @Slot (result = bool )
836842 def isFinishedOrRunning (self ):
0 commit comments