Small bugfix
This commit is contained in:
@@ -8,6 +8,9 @@ export class CameraRunner {
|
||||
|
||||
socket: Socket;
|
||||
|
||||
errorTriggerStartupDelay = 10000;
|
||||
bootTime = Date.now();
|
||||
|
||||
state: ServiceState = 'DISCONNECTED';
|
||||
message?: string;
|
||||
error?: string;
|
||||
@@ -76,6 +79,12 @@ export class CameraRunner {
|
||||
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 ?? error);
|
||||
else console.log(PREFIX, message ?? error);
|
||||
@@ -147,6 +156,7 @@ export class CameraRunner {
|
||||
});
|
||||
|
||||
this.socket.on('connect', () => {
|
||||
this._Main.Twilio.resetError('CameraRunner');
|
||||
this.setInfo('Connected', null, 'CONNECTED');
|
||||
this.startPollClock();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user