Small bugfix

This commit is contained in:
2025-10-24 16:21:04 +02:00
parent 02391f813b
commit 7ce9003621
21 changed files with 601 additions and 10 deletions

View File

@@ -42,6 +42,8 @@ var Utils_1 = require("./Utils");
var PREFIX = "[CameraRunner]";
var CameraRunner = /** @class */ (function () {
function CameraRunner(Main) {
this.errorTriggerStartupDelay = 10000;
this.bootTime = Date.now();
this.state = 'DISCONNECTED';
this.processStatus = {
state: 'STOPPED',
@@ -92,6 +94,9 @@ var CameraRunner = /** @class */ (function () {
this.error = error;
this.state = state;
this.broadcastState();
if (error != null &&
Date.now() - this.bootTime > this.errorTriggerStartupDelay)
this._Main.Twilio.sendError('CameraRunner', error);
if (state == 'FAILED' || state == 'DISCONNECTED')
console.warn(PREFIX, message !== null && message !== void 0 ? message : error);
else
@@ -175,6 +180,7 @@ var CameraRunner = /** @class */ (function () {
reconnectionDelay: 2000,
});
this.socket.on('connect', function () {
_this._Main.Twilio.resetError('CameraRunner');
_this.setInfo('Connected', null, 'CONNECTED');
_this.startPollClock();
});