mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Poor attempt to fix the 33 years bug.
This commit is contained in:
parent
f7d5be5ee8
commit
d1bbb015a8
@ -76,7 +76,8 @@ class UptimeDB(object):
|
||||
fd.close()
|
||||
|
||||
def add(self):
|
||||
if not any(lambda t: t[0] == world.startedAt, self.uptimes):
|
||||
if world.startedAt != 0 and \
|
||||
not any(lambda t: t[0] == world.startedAt, self.uptimes):
|
||||
self.uptimes.append((world.startedAt, None))
|
||||
|
||||
def top(self, n=3):
|
||||
@ -92,7 +93,7 @@ class UptimeDB(object):
|
||||
def notNone(t):
|
||||
return t[1] is not None
|
||||
utils.sortBy(decorator, self.uptimes, cmp=invertCmp(cmp))
|
||||
return list(islice(ifilter(notNone, self.uptimes), 3))
|
||||
return list(islice(ifilter(notNone, self.uptimes), n))
|
||||
|
||||
def update(self):
|
||||
for (i, t) in enumerate(self.uptimes):
|
||||
|
Loading…
Reference in New Issue
Block a user