mirror of
https://github.com/koush/scrypted.git
synced 2026-06-21 00:50:30 +01:00
unifi-protect: restart the entire plugin if websocket times out. revisit this as this is bad when there are multiple udm hubs being managed and only 1 is offline.
This commit is contained in:
2
external/unifi-protect
vendored
2
external/unifi-protect
vendored
Submodule external/unifi-protect updated: 564bfda557...539513af92
4
plugins/unifi-protect/package-lock.json
generated
4
plugins/unifi-protect/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.118",
|
||||
"version": "0.0.119",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.118",
|
||||
"version": "0.0.119",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/unifi-protect",
|
||||
"version": "0.0.118",
|
||||
"version": "0.0.119",
|
||||
"description": "Unifi Protect Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -270,10 +270,8 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device
|
||||
}
|
||||
|
||||
const onWsTimeout = () => {
|
||||
this.console.log('Event Listener timeout. Restarting listener.');
|
||||
this.api?.eventsWs?.removeAllListeners();
|
||||
this.api?.eventsWs?.close();
|
||||
this.discoverDevices(0);
|
||||
this.console.log('Event Listener timeout. Restarting plugin.');
|
||||
sdk.deviceManager.requestRestart();
|
||||
};
|
||||
let wsTimeout: NodeJS.Timeout;
|
||||
const resetWsTimeout = () => {
|
||||
|
||||
Reference in New Issue
Block a user