Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: using
sched
in rate-limited callables no longer breaks
This appears to have been fixed as part of the big rule-system rewrite back in 7.1. The rule system now also considers the *start* time of the callable's most recent run in the given context, if it hasn't finished running since the last time it was started. I also tested this with a very basic plugin: import sched import time from sopel import plugin s = sched.scheduler(time.time, time.sleep) @plugin.rate(60) @plugin.command('testrate') def rate_limited(bot, trigger): s.enter(30, 2, bot.say, argument=('hi',)) s.run() Despite trying to run `.testrate` three times in a few seconds, as a non admin user, the bot only said "hi" once.
- Loading branch information