Force process crash on mqtt error

To circumvent this error https://community.flic.io/topic/18257/cannot-push-beyond-allocated-stack-fatal-error
This commit is contained in:
Mike Vostrikov committed 2023-08-19 01:48:23 -04:00
1 parent a633db73c8
commit 7effbdb27a
1 file changed
+4 -6
+4 -6
View File
@@ -218,12 +218,10 @@ mqtt.on('disconnected', function() {
mqtt.connect();
});
mqtt.on('error', function() {
setTimeout(function (){
mqtt.connect();
}, 1000);
mqtt.on('error', function () {
setTimeout(function () {
throw new Error("Crashed")
}, 1000);
});
mqtt.connect();