mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Fixed the problem of having multiple upkeeps scheduled.
This commit is contained in:
parent
3851d1d152
commit
e609d5dfd7
@ -379,7 +379,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||
|
||||
Runs the standard upkeep stuff (flushes and gc.collects()).
|
||||
"""
|
||||
collected = world.upkeep()
|
||||
collected = world.upkeep(scheduleNext=False)
|
||||
if gc.garbage:
|
||||
irc.reply('Garbage! %r' % gc.garbage)
|
||||
else:
|
||||
|
@ -77,7 +77,7 @@ def flush():
|
||||
except Exception, e:
|
||||
log.exception('Uncaught exception in flusher:')
|
||||
|
||||
def upkeep():
|
||||
def upkeep(scheduleNext=True):
|
||||
"""Does upkeep (like flushing, garbage collection, etc.)"""
|
||||
sys.exc_clear() # Just in case, let's clear the exception info.
|
||||
collected = gc.collect()
|
||||
@ -107,6 +107,7 @@ def upkeep():
|
||||
log.info('%s Flushers flushed and garbage collected.', timestamp)
|
||||
else:
|
||||
log.info('%s Garbage collected.', timestamp)
|
||||
if scheduleNext:
|
||||
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||
return collected
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user