mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +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,7 +107,8 @@ def upkeep():
|
||||
log.info('%s Flushers flushed and garbage collected.', timestamp)
|
||||
else:
|
||||
log.info('%s Garbage collected.', timestamp)
|
||||
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||
if scheduleNext:
|
||||
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||
return collected
|
||||
|
||||
def makeDriversDie():
|
||||
|
Loading…
Reference in New Issue
Block a user