Skip to content

Commit d89b6e6

Browse files
committed
allow job registration after module loads
1 parent 2404004 commit d89b6e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rtmbot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def input(self, data):
4040
function_name = "process_" + data["type"]
4141
dbg("got {}".format(function_name))
4242
for plugin in self.bot_plugins:
43+
plugin.register_jobs()
4344
plugin.do(function_name, data)
4445
def output(self):
4546
for plugin in self.bot_plugins:
@@ -84,6 +85,7 @@ def register_jobs(self):
8485
for interval, function in self.module.crontable:
8586
self.jobs.append(Job(interval, eval("self.module."+function)))
8687
logging.info(self.module.crontable)
88+
self.module.crontable = []
8789
else:
8890
self.module.crontable = []
8991
def do(self, function_name, data):

0 commit comments

Comments
 (0)