mirror of
https://github.com/ep1cman/unifi-protect-backup.git
synced 2026-01-03 09:03:50 +00:00
Both network issues and restarts of Unifi Protect can cause the websocket to disconnect. Once this happens, no more events are recieved, and hence no events are stored via rclone. We add a task which checks that the websocket is connected every minute. If the websocket is not connected, the connection is totally reset. For a simple network issue, is should be sufficient to just call pyunifiprotect's update(), but this doesn't work when protect has been restarted. Given that this is a tool that should always be running, we opt for the most extreme option of totally resetting the connection, and re-establishing it from scratch.