Merge lp:~isoschiz/endroid/crontaskdecorator into lp:endroid
Proposed by
Martin Morrison
Status: | Merged |
---|---|
Approved by: | Phil Connell |
Approved revision: | 51 |
Merged at revision: | 51 |
Proposed branch: | lp:~isoschiz/endroid/crontaskdecorator |
Merge into: | lp:endroid |
Diff against target: |
273 lines (+94/-21) 6 files modified
src/endroid/cron.py (+51/-8) src/endroid/pluginmanager.py (+22/-0) src/endroid/plugins/command.py (+6/-0) src/endroid/plugins/help.py (+8/-5) src/endroid/plugins/ratelimit.py (+4/-4) src/endroid/usermanagement.py (+3/-4) |
To merge this branch: | bzr merge lp:~isoschiz/endroid/crontaskdecorator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Phil Connell | Approve | ||
ChrisD | Needs Fixing | ||
Review via email: mp+180739@code.launchpad.net |
Commit message
Merge in new @task handler.
Description of the change
Adds a @task decorator in the cron module that can be used to decorate methods that are to be used as timed callback handlers. The decorator converts these into a Task object, via the use of a descriptor (which ensures the Task is created by the specific cron associated with the given plugin: for now, there is a single Cron, but this code is future proof for when we have per-plugin Crons).
Also has minor tweaks to help and ratelimit to use some new features.
To post a comment you must log in.
What's with the lowercase d?
Also the decorator class could do with more comments.
Can you add comments around all functools calls as well?
Finally, I think this might break some usage of persistent crons because it appears to delay registration until the task is used (if I'm following correctly). This might mean after a restart that a plugin might not have re-registered a persistent cron by he time it fires.
Appreciate the other updates :)