ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
580 stars 25 forks source link

Websocket not re-established if Unifi Protect restarts #12

Closed ep1cman closed 2 years ago

ep1cman commented 2 years ago

Description

Currently if UniFi Protect stops for any reason (e.g. a nightly update) the application does not realise the connection is a dead and never reconnects.

Sticklyman1936 commented 2 years ago

I've tried to address this here: https://github.com/ep1cman/unifi-protect-backup/pull/13

Happy to hear your thoughts. I'm not overly happy with the solution to be frank, but it might work as a stopgap.

ep1cman commented 2 years ago

I agree its not an idea solution, but in my experience its tricky to know when a websocket has disconnected quickly, and pyunifiprotect doesn't really leave us a lot of options with how it handles managing its internal state. I suspect this will be "good enough". Thanks again for the patch :)