-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron #60
Cron #60
Conversation
…ff events with a time delta
…inCron::at and PluginCron::every
… from the same plugin are registered
…hey were scheduled to be called at.
…name and some args to call it with when the time is up, and there is just one repeating task (the scheduler) which handles everything. This is to allow saving things to the database, although that isn't done yet.
…ison is restarted
… named method change)
… allow tasks which themselves schedule other tasks
# shouldn't get this far anyway, killing the bot is worse. | ||
try: | ||
func(taskdef['time'], *taskdef['args'], **taskdef['kwargs']) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be except Exception:
- just using except:
will catch everything, including important signals like KeyboardInterrupt
(which the Twisted reactor handles to shutdown gracefully). except Exception as e:
would even give you the exception instead of having to poke sys.exc_info()
.
I wonder if the task definition could be restructured somewhat to remove some duplication of information?
Are there cases you were considering where you might want a task name not tied to a plugin name, or triggering callbacks on other plugins? |
cron.
(cron)