-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Scheduled command runs at different times #1172
Comments
i guess the parameter of @module.interval(new_time) is just set once and therefore contains the initial amount of seconds for the next runs. |
Sopel expects the number passed in @module.interval to be a constant, not a
variable. Because of this it only checks the value when registering your
function, not on every pass.
So yes. This is expected behaviour.
|
ah, it's that simple. argh. thanks. so, is there a proper way to schedule things? |
"Proper"? No, not at this time. I'll close this question, as the feature request of scheduling callables for a specific clock time (instead of an interval) is covered by #1222. |
@nakami Can you share the working script? Trying to figure out on how to get the sopel bot say something after midnight, cannot find any working example... |
Any hint? |
@ronilaukkarinen Did you visit the linked issue? #1222 (comment) shows some approaches to this. |
Running sopel on CentOS release 6.8, Python 3.4.3.
I have a module containing a command that is supposed to run at UTC 0:00 + 2 minutes offset.
However, it runs at unexpected times, after the first successful run.
this is the relevant code:
first time:
00:02:01 bot: [Triggered] this should trigger 2min after midnight
✔️same day, later:
23:54:49 bot: [Triggered] this should trigger 2min after midnight
✖️day after:
23:43:39 bot: [Triggered] this should trigger 2min after midnight
✖️day after:
23:40:28 bot: [Triggered] this should trigger 2min after midnight
✖️day after:
23:33:16 bot: [Triggered] this should trigger 2min after midnight
✖️however, my debug command returns the expected seconds value.
what did i screw up? is this expected behaviour?
The text was updated successfully, but these errors were encountered: