@servicelabsco/nestjs-utility-services 1.2.10 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.controller.js +5 -1
- package/dist/app.controller.js.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/console.js +1 -0
- package/dist/console.js.map +1 -1
- package/dist/platformUtility/commands/maintenance.command.d.ts +1 -7
- package/dist/platformUtility/commands/maintenance.command.js +2 -32
- package/dist/platformUtility/commands/maintenance.command.js.map +1 -1
- package/dist/platformUtility/consumers/event.consumer.d.ts +2 -5
- package/dist/platformUtility/consumers/event.consumer.js +7 -33
- package/dist/platformUtility/consumers/event.consumer.js.map +1 -1
- package/dist/platformUtility/es6.classes.d.ts +1 -1
- package/dist/platformUtility/libraries/common.sqs.polling.d.ts +0 -1
- package/dist/platformUtility/libraries/common.sqs.polling.js +1 -9
- package/dist/platformUtility/libraries/common.sqs.polling.js.map +1 -1
- package/dist/platformUtility/services/maintenance.service.d.ts +14 -9
- package/dist/platformUtility/services/maintenance.service.js +58 -32
- package/dist/platformUtility/services/maintenance.service.js.map +1 -1
- package/dist/platformUtility/services/queue.service.d.ts +0 -1
- package/dist/platformUtility/services/queue.service.js +6 -1
- package/dist/platformUtility/services/queue.service.js.map +1 -1
- package/dist/platformUtility/services/shutdown.service.d.ts +3 -3
- package/dist/platformUtility/services/shutdown.service.js +5 -10
- package/dist/platformUtility/services/shutdown.service.js.map +1 -1
- package/dist/system/commands/event.queue.command.d.ts +1 -3
- package/dist/system/commands/event.queue.command.js +2 -10
- package/dist/system/commands/event.queue.command.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/worker.service.d.ts +3 -5
- package/dist/worker.service.js +5 -12
- package/dist/worker.service.js.map +1 -1
- package/package.json +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shutdown.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/shutdown.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,yBAAuB;AACvB,8EAA0E;AAC1E
|
1
|
+
{"version":3,"file":"shutdown.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/shutdown.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,yBAAuB;AACvB,8EAA0E;AAC1E,+DAA2D;AASpD,IAAM,eAAe,uBAArB,MAAM,eAAe;IAQxB,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAMvE,KAAK,CAAC,eAAe;QACjB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAQO,KAAK,CAAC,qBAAqB;QAC/B,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;QAE/C,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QACnE,IAAI,CAAC,sBAAsB;YAAE,OAAO;QAEpC,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAE/E,iBAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC;QACxC,OAAO,kCAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;;AAnCQ,0CAAe;AACT,gCAAgB,GAAY,KAAK,AAAjB,CAAkB;0BADxC,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCASwC,wCAAkB;GAR1D,eAAe,CAoC3B"}
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { MaintenanceService } from '../../platformUtility/services/maintenance.service';
|
1
2
|
import { QueueService } from '../../platformUtility/services/queue.service';
|
2
3
|
import { EventQueueService } from '../services/event.queue.service';
|
3
|
-
import { MaintenanceService } from '../../platformUtility/services/maintenance.service';
|
4
4
|
export declare class EventQueueCommand {
|
5
5
|
private readonly queueService;
|
6
6
|
private readonly eventQueueService;
|
@@ -8,10 +8,8 @@ export declare class EventQueueCommand {
|
|
8
8
|
private counter;
|
9
9
|
private start_time;
|
10
10
|
private startTimeIdentifier;
|
11
|
-
private logger;
|
12
11
|
constructor(queueService: QueueService, eventQueueService: EventQueueService, maintenanceService: MaintenanceService);
|
13
12
|
process(): Promise<void>;
|
14
13
|
private processEvents;
|
15
14
|
private processEvent;
|
16
|
-
private checkForSystem;
|
17
15
|
}
|
@@ -13,11 +13,10 @@ exports.EventQueueCommand = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const nestjs_console_1 = require("nestjs-console");
|
15
15
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
16
|
+
const maintenance_service_1 = require("../../platformUtility/services/maintenance.service");
|
16
17
|
const queue_service_1 = require("../../platformUtility/services/queue.service");
|
17
18
|
const event_queue_service_1 = require("../services/event.queue.service");
|
18
19
|
const date_util_1 = require("./../../common/libraries/date.util");
|
19
|
-
const maintenance_service_1 = require("../../platformUtility/services/maintenance.service");
|
20
|
-
const process = require("process");
|
21
20
|
let EventQueueCommand = class EventQueueCommand {
|
22
21
|
constructor(queueService, eventQueueService, maintenanceService) {
|
23
22
|
this.queueService = queueService;
|
@@ -26,12 +25,10 @@ let EventQueueCommand = class EventQueueCommand {
|
|
26
25
|
this.counter = 0;
|
27
26
|
this.start_time = date_util_1.DateUtil.now();
|
28
27
|
this.startTimeIdentifier = date_util_1.DateUtil.getDateTimeInFormat();
|
29
|
-
this.logger = new common_1.Logger('EventQueue');
|
30
28
|
}
|
31
29
|
async process() {
|
32
30
|
while (true) {
|
33
|
-
await this.
|
34
|
-
await this.checkForSystem();
|
31
|
+
await this.maintenanceService.holdInstanceIfDisabled();
|
35
32
|
const pendingEvents = await this.eventQueueService.getActiveEvents();
|
36
33
|
if (!pendingEvents.length)
|
37
34
|
await platform_utility_1.PlatformUtility.sleep(2000);
|
@@ -57,11 +54,6 @@ let EventQueueCommand = class EventQueueCommand {
|
|
57
54
|
event.end_time = date_util_1.DateUtil.getDateTime();
|
58
55
|
return event.save();
|
59
56
|
}
|
60
|
-
async checkForSystem() {
|
61
|
-
await this.maintenanceService.checkForMaintenance('queueInstance');
|
62
|
-
if (this.maintenanceService.nodeNeedsRestart())
|
63
|
-
process.exit(1);
|
64
|
-
}
|
65
57
|
};
|
66
58
|
exports.EventQueueCommand = EventQueueCommand;
|
67
59
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"event.queue.command.js","sourceRoot":"","sources":["../../../src/system/commands/event.queue.command.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"event.queue.command.js","sourceRoot":"","sources":["../../../src/system/commands/event.queue.command.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAAkD;AAClD,8EAA0E;AAC1E,4FAAwF;AACxF,gFAA4E;AAE5E,yEAAoE;AACpE,kEAA8D;AAIvD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAW1B,YACqB,YAA0B,EAC1B,iBAAoC,EACpC,kBAAsC;QAFtC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAbnD,YAAO,GAAG,CAAC,CAAC;QACZ,eAAU,GAAG,oBAAQ,CAAC,GAAG,EAAE,CAAC;QAC5B,wBAAmB,GAAG,oBAAQ,CAAC,mBAAmB,EAAE,CAAC;IAY1D,CAAC;IAME,AAAN,KAAK,CAAC,OAAO;QACT,OAAO,IAAI,EAAE;YACT,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;YAEvD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC;YAErE,IAAI,CAAC,aAAa,CAAC,MAAM;gBAAE,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