-
Notifications
You must be signed in to change notification settings - Fork 86
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
Secondary upload destination #189
base: main
Are you sure you want to change the base?
Secondary upload destination #189
Conversation
I had a play with this code (i.e. I wanted to use it in the future, so I thought I'd import it now, ready for when I really wanted it). I wonder if there is a safer way of doing this? |
Yes, this was a bit rushed to get the data I needed in and not enough testing of each scenario. Scanning the code it looks like the try for the whole block will fail on there being no module called "None" to import. A simple fix would be to put the module import in an "if secondary_destination:" block, although I suspect further work on try blocks would be better. There may be more fallout from expecting that module to exist etc. I vaguely recall having a lot of fun with all those tries and they are not my forte. I'll set up None in config.py and develop something more robust, might take a few days, especially as my board has currently mysteriously fallen out with my DHCP server. |
@gbravery I have put the if statements in for the secondary destination code. I've tested it works as expected with influxdb or None set. |
Add a secondary upload destination in the config file that defaults to None.
Modified the __init__.py upload readings function to have a stab at the secondary upload once the full set of primary attempts are complete.
The secondary will not retry data if the primary is successful and equally the secondary will receive duplicates if the primary experiences issues on the previous pass.
This is designed to allow me to get extra diagnostic data to my influxdb while not interrupting the Wunderground data upload.
The above could be improved with better error handling logic if there is demand.
This makes improvements in the direction requested in #38 for more concurrent destinations.