We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This plugin: https://github.com/MetPX/sarracenia/blob/development/sarracenia/flowcb/poll/airnow.py
Doesn't work because self.o.scheduled_interval is a string, when the config has scheduled_interval 900.
self.o.scheduled_interval
scheduled_interval 900
I added a line to print the value and type:
[DEBUG] poll.airnow poll sleep is 900 <class 'str'>
I tried setting it to 900s, but that didn't work either:
[DEBUG] poll.airnow poll sleep is 900s <class 'str'>
I don't understand why this isn't causing problems anywhere else.
The text was updated successfully, but these errors were encountered:
I think it likely has something to do with the order that plugins are loaded in.
It looks like the poll plugin is loaded before the scheduled plugin, and that's where the scheduled_interval option is defined as a duration type.
16:41:29,776 [DEBUG] sarracenia.flow run callbacks loaded: ['sarracenia.flowcb.post.message.Message', 'sarracenia.flowcb.gather.message.Message', 'sarracenia.flowcb.retry.Retry', 'sarracenia.flowcb.housekeeping.resources.Resources', 'sarracenia.flowcb.nodupe.disk.Disk', 'poll.airnow', 'log', 'sarracenia.flowcb.scheduled.poll.Poll']
Sorry, something went wrong.
I tried adding a constructor to the airnow poll plugin with self.o.add_option('scheduled_interval', kind='duration') and it doesn't help.
self.o.add_option('scheduled_interval', kind='duration')
But I am sure that inside the actual scheduled code (https://github.com/MetPX/sarracenia/blob/development/sarracenia/flowcb/scheduled/__init__.py), it is not a string.
I see 2025-02-26 16:49:42,855 [DEBUG] sarracenia.config add_option 29 scheduled_interval declared as type:<class 'float'> value:900s in the logs.
2025-02-26 16:49:42,855 [DEBUG] sarracenia.config add_option 29 scheduled_interval declared as type:<class 'float'> value:900s
And [DEBUG] sarracenia.flowcb.scheduled calc_next_gather_time next gather should be in 900.0s, scheduled for 2025-02-26 17:04:42.893077+00:00 which should say 900ss if scheduled_interval was a string there. https://github.com/MetPX/sarracenia/blob/development/sarracenia/flowcb/scheduled/__init__.py#L140
[DEBUG] sarracenia.flowcb.scheduled calc_next_gather_time next gather should be in 900.0s, scheduled for 2025-02-26 17:04:42.893077+00:00
900ss
I added a call to durationToSeconds in the plugin as a workaround for now
No branches or pull requests
This plugin: https://github.com/MetPX/sarracenia/blob/development/sarracenia/flowcb/poll/airnow.py
Doesn't work because
self.o.scheduled_interval
is a string, when the config hasscheduled_interval 900
.I added a line to print the value and type:
I tried setting it to 900s, but that didn't work either:
I don't understand why this isn't causing problems anywhere else.
The text was updated successfully, but these errors were encountered: