mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +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()
|
fd.close()
|
||||||
|
|
||||||
def add(self):
|
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))
|
self.uptimes.append((world.startedAt, None))
|
||||||
|
|
||||||
def top(self, n=3):
|
def top(self, n=3):
|
||||||
@ -92,7 +93,7 @@ class UptimeDB(object):
|
|||||||
def notNone(t):
|
def notNone(t):
|
||||||
return t[1] is not None
|
return t[1] is not None
|
||||||
utils.sortBy(decorator, self.uptimes, cmp=invertCmp(cmp))
|
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):
|
def update(self):
|
||||||
for (i, t) in enumerate(self.uptimes):
|
for (i, t) in enumerate(self.uptimes):
|
||||||
|
Loading…
Reference in New Issue
Block a user