Skip to content

Commit 5600dcf

Browse files
committed
Turn down agression for workitem queue
1 parent 603eb04 commit 5600dcf

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,15 @@ export class DatabaseConnection extends events.EventEmitter {
260260
}
261261
if (!NoderedUtil.IsNullEmpty(wiq.robotqueue) && !NoderedUtil.IsNullEmpty(wiq.workflowid)) {
262262
Logger.instanse.verbose("[workitems] Send invoke message to robot queue " + wiq.workflowid);
263-
await amqpwrapper.Instance().send(null, wiq.robotqueue, payload, 5000, null, null, 2);
263+
let expiration = (Config.amqp_requeue_time / 2, 10) | 0;
264+
if (expiration < 500) expiration = 500;
265+
await amqpwrapper.Instance().send(null, wiq.robotqueue, payload, expiration, null, null, 2);
264266
}
265267
if (!NoderedUtil.IsNullEmpty(wiq.amqpqueue)) {
266268
Logger.instanse.verbose("[workitems] Send invoke message to amqp queue " + wiq.amqpqueue);
267-
await amqpwrapper.Instance().send(null, wiq.amqpqueue, payload, 5000, null, null, 2);
269+
let expiration = (Config.amqp_requeue_time / 2, 10) | 0;
270+
if (expiration < 500) expiration = 500;
271+
await amqpwrapper.Instance().send(null, wiq.amqpqueue, payload, expiration, null, null, 2);
268272
}
269273
}
270274
}

OpenFlow/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function doHouseKeeping() {
5959
var msg2 = new Message(); msg2.jwt = Crypt.rootToken();
6060
var h = dt.getHours();
6161
var skipUpdateUsage: boolean = !(dt.getHours() == 1 || dt.getHours() == 13);
62-
msg2.Housekeeping(false, skipUpdateUsage, skipUpdateUsage, null).catch((error) => Logger.instanse.error(error));
62+
msg2._Housekeeping(false, skipUpdateUsage, skipUpdateUsage, null).catch((error) => Logger.instanse.error(error));
6363

6464
// var dt = new Date(new Date().toISOString());
6565
// var msg = new Message(); msg.jwt = Crypt.rootToken();

0 commit comments

Comments
 (0)