Skip to content

Commit 1e26fe8

Browse files
committed
fix amqp reconnect for rpa
1 parent 4a62256 commit 1e26fe8

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.2.103",
3+
"version": "1.2.104",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

OpenFlowNodeRED/src/nodered/nodes/rpa_nodes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ export class rpa_detector_node {
4949
this.localqueue = await NoderedUtil.RegisterQueue(WebSocketClient.instance, this.config.queue, (msg: QueueMessage, ack: any) => {
5050
this.OnMessage(msg, ack);
5151
}, (msg) => {
52+
this.localqueue = "";
5253
if (this != null && this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected" });
5354
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
5455
});
5556
this.node.status({ fill: "green", shape: "dot", text: "Connected" });
5657
} catch (error) {
58+
this.localqueue = "";
5759
NoderedUtil.HandleError(this, error, null);
60+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
5861
}
5962
}
6063
async OnMessage(msg: any, ack: any) {
@@ -154,13 +157,16 @@ export class rpa_workflow_node {
154157
this.localqueue = await NoderedUtil.RegisterQueue(WebSocketClient.instance, this.localqueue, (msg: QueueMessage, ack: any) => {
155158
this.OnMessage(msg, ack);
156159
}, (msg) => {
160+
this.localqueue = "";
157161
if (this != null && this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected" });
158162
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
159163
});
160164
this.node.status({ fill: "green", shape: "dot", text: "Connected " + this.localqueue });
161165

162166
} catch (error) {
167+
this.localqueue = "";
163168
NoderedUtil.HandleError(this, error, null);
169+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
164170
}
165171
}
166172
async OnMessage(msg: any, ack: any) {
@@ -365,13 +371,16 @@ export class rpa_killworkflows_node {
365371
this.localqueue = await NoderedUtil.RegisterQueue(WebSocketClient.instance, this.localqueue, (msg: QueueMessage, ack: any) => {
366372
this.OnMessage(msg, ack);
367373
}, (msg) => {
374+
this.localqueue = "";
368375
if (this != null && this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected" });
369376
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
370377
});
371378
this.node.status({ fill: "green", shape: "dot", text: "Connected " + this.localqueue });
372379

373380
} catch (error) {
381+
this.localqueue = "";
374382
NoderedUtil.HandleError(this, error, null);
383+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
375384
}
376385
}
377386
async OnMessage(msg: any, ack: any) {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.103
1+
1.2.104

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.2.103",
3+
"version": "1.2.104",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)