mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +01:00
Moved the gc.collect until the end.
This commit is contained in:
parent
0c51ead69d
commit
f099a53374
@ -89,7 +89,6 @@ def debugFlush(s=''):
|
|||||||
def upkeep(scheduleNext=True):
|
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()
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
try:
|
try:
|
||||||
import msvcrt
|
import msvcrt
|
||||||
@ -98,9 +97,6 @@ def upkeep(scheduleNext=True):
|
|||||||
pass
|
pass
|
||||||
except IOError: # Win98 sux0rs!
|
except IOError: # Win98 sux0rs!
|
||||||
pass
|
pass
|
||||||
if gc.garbage:
|
|
||||||
log.warning('Uncollectable garbage (file this as a bug on SF.net): %s',
|
|
||||||
gc.garbage)
|
|
||||||
if conf.daemonized:
|
if conf.daemonized:
|
||||||
# If we're daemonized, sys.stdout has been replaced with a StringIO
|
# If we're daemonized, sys.stdout has been replaced with a StringIO
|
||||||
# object, so let's see if anything's been printed, and if so, let's
|
# object, so let's see if anything's been printed, and if so, let's
|
||||||
@ -136,6 +132,10 @@ def upkeep(scheduleNext=True):
|
|||||||
log.info('%s Garbage collected.', timestamp)
|
log.info('%s Garbage collected.', timestamp)
|
||||||
if scheduleNext:
|
if scheduleNext:
|
||||||
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
schedule.addEvent(upkeep, time.time() + conf.supybot.upkeepInterval())
|
||||||
|
collected = gc.collect()
|
||||||
|
if gc.garbage:
|
||||||
|
log.warning('Uncollectable garbage (file this as a bug on SF.net): %s',
|
||||||
|
gc.garbage)
|
||||||
return collected
|
return collected
|
||||||
|
|
||||||
def makeDriversDie():
|
def makeDriversDie():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user