mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made the interval between upkeeps configurable.
This commit is contained in:
parent
c290465c80
commit
a178492453
@ -64,7 +64,7 @@ def main():
|
|||||||
import world
|
import world
|
||||||
import drivers
|
import drivers
|
||||||
import schedule
|
import schedule
|
||||||
schedule.addPeriodicEvent(world.upkeep, 300)
|
world.upkeep()
|
||||||
world.startedAt = started
|
world.startedAt = started
|
||||||
while world.ircs:
|
while world.ircs:
|
||||||
try:
|
try:
|
||||||
|
@ -345,6 +345,11 @@ supybot.register('pingInterval', registry.Integer(120, """Determines the
|
|||||||
number of seconds between sending pings to the server, if pings are being sent
|
number of seconds between sending pings to the server, if pings are being sent
|
||||||
to the server."""))
|
to the server."""))
|
||||||
|
|
||||||
|
supybot.register('upkeepInterval', registry.PositiveInteger(300, """Determines
|
||||||
|
the number of seconds between running the upkeep function that flushes
|
||||||
|
(commits) open databases, collects garbage, and records some useful statistics
|
||||||
|
at the debugging level."""))
|
||||||
|
|
||||||
supybot.register('flush', registry.Boolean(True, """Determines whether the bot
|
supybot.register('flush', registry.Boolean(True, """Determines whether the bot
|
||||||
will periodically flush data and configuration files to disk. Generally, the
|
will periodically flush data and configuration files to disk. Generally, the
|
||||||
only time you'll want to set this to False is when you want to modify those
|
only time you'll want to set this to False is when you want to modify those
|
||||||
|
@ -50,6 +50,7 @@ import log
|
|||||||
import conf
|
import conf
|
||||||
import drivers
|
import drivers
|
||||||
import ircutils
|
import ircutils
|
||||||
|
import schedule
|
||||||
|
|
||||||
startedAt = time.time() # Just in case it doesn't get set later.
|
startedAt = time.time() # Just in case it doesn't get set later.
|
||||||
|
|
||||||
@ -97,6 +98,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)
|
||||||
|
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||||
return collected
|
return collected
|
||||||
|
|
||||||
def makeDriversDie():
|
def makeDriversDie():
|
||||||
|
Loading…
Reference in New Issue
Block a user