prairiedogbeer / fermenator

Fermentation monitoring and management software
0 stars 0 forks source link

Firebase token expires after several days of operation and hangs thread #6

Closed geradcoles closed 7 years ago

geradcoles commented 7 years ago

Here's what the error looks like in the logs:

File "/usr/local/lib/python3.4/dist-packages/pyrebase/pyrebase.py", line 444, in raise_detailed_error
request_object.raise_for_status()
File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 937, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://brewconsole.firebaseio.com/config/fermenator/version/.json
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/fermenator", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/home/gerad/fermenator/bin/fermenator", line 71, in <module>
main()
File "/home/gerad/fermenator/bin/fermenator", line 66, in main
f_man.run()

Catch the HTTPError and invalidate the handle so that a new connection will be created.