Changeset 3362

Show
Ignore:
Timestamp:
01/13/10 18:44:29 (10 years ago)
Author:
armon
Message:

Fixed an indexing bug in the stoptime logger, and handle the corner case of no available stoptimes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/cadet/stoptime_logger.repy

    r3343 r3362  
    173173 
    174174  # Check if the index is outside the array 
    175   if stoptimes[right_index][0] <= comptime or right_index < 0: 
     175  if right_index < 0 or stoptimes[right_index][0] <= comptime: 
    176176    return right_index + 1 
    177177  else: 
     
    187187    check_time = getruntime() 
    188188    lim, usage, stoptimes = getresources() 
     189 
     190    # Skip if there are no stoptimes 
     191    if len(stoptimes) == 0: 
     192      sleep(TIME_BETWEEN_SAMPLES - (getruntime() - check_time)) 
    189193 
    190194    # Find the next entry