3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-25 18:00:39 +01:00

automode: call unregisterService() on unload

This commit is contained in:
James Lu 2016-07-07 22:41:51 -07:00
parent 4f26a29196
commit f97f2d2fda

View File

@ -13,7 +13,7 @@ mydesc = ("The \x02Automode\x02 plugin provides simple channel ACL management by
"to users matching hostmasks or exttargets.") "to users matching hostmasks or exttargets.")
# Register ourselves as a service. # Register ourselves as a service.
modebot = utils.registerService("Automode", desc=mydesc) modebot = utils.registerService("automode", desc=mydesc)
reply = modebot.reply reply = modebot.reply
# Databasing variables. # Databasing variables.
@ -69,12 +69,14 @@ def die(sourceirc):
"""Saves the Automode database and quit.""" """Saves the Automode database and quit."""
exportDB() exportDB()
# Kill the scheduling forexports. # Kill the scheduling for exports.
global exportdb_timer global exportdb_timer
if exportdb_timer: if exportdb_timer:
log.debug("Automode: cancelling exportDB timer thread %s due to die()", threading.get_ident()) log.debug("Automode: cancelling exportDB timer thread %s due to die()", threading.get_ident())
exportdb_timer.cancel() exportdb_timer.cancel()
utils.unregisterService('automode')
def setacc(irc, source, args): def setacc(irc, source, args):
"""<channel> <mask> <mode list OR literal -> """<channel> <mask> <mode list OR literal ->