mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Updated world.upkeep to return the number of objects that have been collected and updated the upkeep command to return that number.
This commit is contained in:
parent
0791d9cbea
commit
bb91ade49e
@ -160,14 +160,14 @@ class OwnerCommands(privmsgs.CapabilityCheckingPrivmsg):
|
||||
|
||||
Runs the standard upkeep stuff (flushes and gc.collects()).
|
||||
"""
|
||||
world.upkeep()
|
||||
collected = world.upkeep()
|
||||
if gc.garbage:
|
||||
if len(gc.garbage) < 10:
|
||||
irc.reply(msg, 'Garbage! %r' % gc.garbage)
|
||||
else:
|
||||
irc.reply(msg, 'Garbage! %s items.' % len(gc.garbage))
|
||||
else:
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
irc.reply(msg, '%s collected' % utils.nItems(collected, 'object'))
|
||||
|
||||
def set(self, irc, msg, args):
|
||||
"""<name> <value>
|
||||
|
@ -79,7 +79,7 @@ except NameError:
|
||||
|
||||
|
||||
def upkeep(): # Function to be run on occasion to do upkeep stuff.
|
||||
gc.collect()
|
||||
collected = gc.collect()
|
||||
if os.name == 'nt':
|
||||
msvcrt.heapmin()
|
||||
if gc.garbage:
|
||||
@ -88,6 +88,7 @@ def upkeep(): # Function to be run on occasion to do upkeep stuff.
|
||||
flush()
|
||||
msg = '%s upkeep ran.' % time.strftime(conf.logTimestampFormat)
|
||||
debug.msg(msg, 'verbose')
|
||||
return collected
|
||||
|
||||
'''
|
||||
def superReload(oldmodule):
|
||||
|
Loading…
Reference in New Issue
Block a user