@emartech/program-executor 3.9.0 → 3.9.1
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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const logger = require('@emartech/json-logger')('program-executor');
|
|
4
|
+
const devLogger = require('@emartech/json-logger')('dev-program-executor');
|
|
4
5
|
const RetryableError = require('../retryable-error');
|
|
5
6
|
const JobHandler = require('../job-data-handler');
|
|
6
7
|
|
|
@@ -13,10 +14,14 @@ class ProgramExecutorProcessor {
|
|
|
13
14
|
|
|
14
15
|
async process(message) {
|
|
15
16
|
const { runId } = message;
|
|
17
|
+
devLogger.info('new job from queue', { runId, OSPID: process.pid });
|
|
16
18
|
|
|
17
19
|
try {
|
|
18
20
|
await this._executeNextJob(message);
|
|
19
21
|
} catch (error) {
|
|
22
|
+
devLogger.error('error in job', { runId, OSPID: process.pid,
|
|
23
|
+
error, errorMessage: error.message, errorCode: error.code,
|
|
24
|
+
errorRetryable: error.retryable, errorIgnorable: error.ignorable });
|
|
20
25
|
if (error.retryable) {
|
|
21
26
|
await this._programHandler.incrementStepRetryCount(runId);
|
|
22
27
|
await this._programHandler.setJobRetriableErrorMessage(runId, error.message);
|
|
@@ -55,9 +60,11 @@ class ProgramExecutorProcessor {
|
|
|
55
60
|
|
|
56
61
|
const remainingJobs = jobs.slice(1);
|
|
57
62
|
if (remainingJobs.length > 0) {
|
|
63
|
+
devLogger.info('queue update remainingJobs', { remainingJobs, runId, OSPID: process.pid });
|
|
58
64
|
await this._queueManager.queueProgram({ ...message, jobs: remainingJobs });
|
|
59
65
|
await this._programHandler.incrementStep(runId);
|
|
60
66
|
} else {
|
|
67
|
+
devLogger.info('finished program', { runId, OSPID: process.pid });
|
|
61
68
|
await this._programHandler.finishProgram(runId);
|
|
62
69
|
}
|
|
63
70
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const devLogger = require('@emartech/json-logger')('dev-program-executor');
|
|
3
4
|
const RunIdGenerator = require('../runid-generator');
|
|
4
5
|
|
|
5
6
|
class ProgramHandler {
|
|
@@ -51,6 +52,7 @@ class ProgramHandler {
|
|
|
51
52
|
|
|
52
53
|
jobData[jobName] = merge ? { ...jobData[jobName], ...payload } : payload;
|
|
53
54
|
|
|
55
|
+
devLogger.info('db update job data', { runId, jobName, payload, merge, OSPID: process.pid });
|
|
54
56
|
return this._programsRepository.setJobDataByRunId(runId, jobData);
|
|
55
57
|
}
|
|
56
58
|
|