Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
tweak date calculation for truncated seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
briandorsey committed Jun 14, 2013
1 parent bdce2ec commit 0d73068
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def annotate_instances(instances):
delta = now - creation
age_minutes = (delta.days * 24 * 60) + (delta.seconds / 60)
inst['_age_minutes'] = age_minutes
if not inst['_excluded'] and age_minutes > CONFIG['TIMEOUT']:
# >= comparison because seconds are truncated above.
if not inst['_excluded'] and age_minutes >= CONFIG['TIMEOUT']:
inst['_timeout_expired'] = True
else:
inst['_timeout_expired'] = False
Expand Down

0 comments on commit 0d73068

Please sign in to comment.