Changeset 74


Ignore:
Timestamp:
04/15/05 11:55:54 (19 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • Added job finished checking if an old jobinfo hasn't been submitted in new list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r73 r74  
    159159        jobAttrs = { }
    160160
    161         def __init__( self ):
    162 
    163                 pass
    164 
    165161        def startElement( self, name, attrs ):
    166162                """
     
    214210                                        debug_msg( 0, 'jobinfo for job %s has changed' %job_id )
    215211                                       
     212        def endElement( self, name, attrs ):
     213                """When all metrics have gone, check if any jobs have finished"""
     214
     215                for jobid, jobinfo in self.jobAttrs.items():
     216
     217                        # This is an old job, not in current jobinfo list anymore
     218                        # it must have finished, since we _did_ get a new heartbeat
     219                        #
     220                        if jobinfo['reported'] < self.heartbeat:
     221
     222                                self.jobAttrs[ jobid ]['status'] = 'F'
     223                                self.jobAttrs[ jobid ]['stop_timestamp'] = self.heartbeat
    216224
    217225        def jobinfoChanged( self, jobattrs, jobid, jobinfo ):
     226                """
     227                Check if jobinfo has changed from jobattrs[jobid]
     228                if it's report time is bigger than previous one
     229                and it is report time is recent (equal to heartbeat)
     230                """
    218231
    219232                if jobattrs.has_key( jobid ):
     
    225238                                        if value != jobattrs[ jobid ][ valname ]:
    226239
    227                                                 return 1
     240                                                if jobinfo['reported'] > jobattrs[ jobid ][ 'reported' ] and jobinfo['reported'] == self.heartbeat:
     241                                                        return 1
    228242
    229243                                else:
Note: See TracChangeset for help on using the changeset viewer.