Added world.starting to know that we shouldn't flush.

This commit is contained in:
Jeremy Fincher 2004-02-12 00:49:41 +00:00
parent 69671d55a3
commit f364bb9705
3 changed files with 10 additions and 3 deletions

View File

@ -261,6 +261,7 @@ if __name__ == '__main__':
import log
import conf
import world
world.starting = True
def closeRegistry():
# We only print if world.dying so we don't see these messages during

View File

@ -189,10 +189,14 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
m = loadPluginModule(name)
loadPluginClass(irc, m)
except Exception, e:
log.exception('Failed to load %s:' % name)
log.exception('Failed to load %s:', name)
else:
# Let's import the module so configuration is preserved.
try:
_ = loadPluginModule(name)
except Exception, e:
log.exception('Failed to load %s:', name)
world.starting = False
def disambiguate(self, irc, tokens, ambiguousCommands=None):
"""Disambiguates the given tokens based on the plugins loaded and

View File

@ -55,6 +55,8 @@ import schedule
startedAt = time.time() # Just in case it doesn't get set later.
starting = False
mainThread = threading.currentThread()
assert 'MainThread' in repr(mainThread)
@ -86,7 +88,7 @@ def upkeep():
pass
if gc.garbage:
log.warning('Uncollectable garbage: %s', gc.garbage)
flushed = conf.supybot.flush()
flushed = conf.supybot.flush() and not starting
if flushed:
flush()
# This is so registry._cache gets filled.