Skip to content

Commit d1b1bcd

Browse files
committed
fix reconnect for workflow, add longer retry timer
1 parent 1e26fe8 commit d1b1bcd

6 files changed

Lines changed: 13 additions & 9 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.104",
3+
"version": "1.2.105",
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/amqp_nodes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class amqp_consumer_node {
132132
this.node.status({ fill: "green", shape: "dot", text: "Connected " + this.localqueue });
133133
} catch (error) {
134134
NoderedUtil.HandleError(this, error, null);
135-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
135+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
136136
}
137137
}
138138
async OnMessage(msg: any, ack: any) {
@@ -242,7 +242,7 @@ export class amqp_publisher_node {
242242
} catch (error) {
243243
this.localqueue = "";
244244
NoderedUtil.HandleError(this, error, null);
245-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
245+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
246246
}
247247
}
248248
async OnMessage(msg: any, ack: any) {
@@ -421,7 +421,7 @@ export class amqp_exchange_node {
421421
this.node.status({ fill: "green", shape: "dot", text: "Connected " + result.exchangename });
422422
} catch (error) {
423423
NoderedUtil.HandleError(this, error, null);
424-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
424+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
425425
}
426426
}
427427
async OnMessage(msg: any, ack: any) {

OpenFlowNodeRED/src/nodered/nodes/rpa_nodes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class rpa_detector_node {
5757
} catch (error) {
5858
this.localqueue = "";
5959
NoderedUtil.HandleError(this, error, null);
60-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
60+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
6161
}
6262
}
6363
async OnMessage(msg: any, ack: any) {
@@ -166,7 +166,7 @@ export class rpa_workflow_node {
166166
} catch (error) {
167167
this.localqueue = "";
168168
NoderedUtil.HandleError(this, error, null);
169-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
169+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
170170
}
171171
}
172172
async OnMessage(msg: any, ack: any) {
@@ -380,7 +380,7 @@ export class rpa_killworkflows_node {
380380
} catch (error) {
381381
this.localqueue = "";
382382
NoderedUtil.HandleError(this, error, null);
383-
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 500);
383+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
384384
}
385385
}
386386
async OnMessage(msg: any, ack: any) {

OpenFlowNodeRED/src/nodered/nodes/workflow_nodes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export class workflow_in_node {
6161
await this.init();
6262
this.node.status({ fill: "green", shape: "dot", text: "Connected " + this.localqueue });
6363
} catch (error) {
64+
this.localqueue = "";
6465
NoderedUtil.HandleError(this, error, null);
66+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
6567
}
6668
}
6769
async init() {
@@ -519,7 +521,9 @@ export class assign_workflow_node {
519521
}
520522
}
521523
} catch (error) {
524+
this.localqueue = "";
522525
NoderedUtil.HandleError(this, error, null);
526+
setTimeout(this.connect.bind(this), (Math.floor(Math.random() * 6) + 1) * 2000);
523527
}
524528
}
525529
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.104
1+
1.2.105

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.104",
3+
"version": "1.2.105",
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)