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()).
|
Runs the standard upkeep stuff (flushes and gc.collects()).
|
||||||
"""
|
"""
|
||||||
collected = world.upkeep()
|
collected = world.upkeep(scheduleNext=False)
|
||||||
if gc.garbage:
|
if gc.garbage:
|
||||||
irc.reply('Garbage! %r' % gc.garbage)
|
irc.reply('Garbage! %r' % gc.garbage)
|
||||||
else:
|
else:
|
||||||
|
@ -77,7 +77,7 @@ def flush():
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.exception('Uncaught exception in flusher:')
|
log.exception('Uncaught exception in flusher:')
|
||||||
|
|
||||||
def upkeep():
|
def upkeep(scheduleNext=True):
|
||||||
"""Does upkeep (like flushing, garbage collection, etc.)"""
|
"""Does upkeep (like flushing, garbage collection, etc.)"""
|
||||||
sys.exc_clear() # Just in case, let's clear the exception info.
|
sys.exc_clear() # Just in case, let's clear the exception info.
|
||||||
collected = gc.collect()
|
collected = gc.collect()
|
||||||
@ -107,6 +107,7 @@ def upkeep():
|
|||||||
log.info('%s Flushers flushed and garbage collected.', timestamp)
|
log.info('%s Flushers flushed and garbage collected.', timestamp)
|
||||||
else:
|
else:
|
||||||
log.info('%s Garbage collected.', timestamp)
|
log.info('%s Garbage collected.', timestamp)
|
||||||
|
if scheduleNext:
|
||||||
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||||
return collected
|
return collected
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user