@seidor-cloud-produtos/orbit-backend-lib 2.0.31 → 2.0.33
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.
|
@@ -34,5 +34,7 @@ class LoggerInMemory extends logger_1.default {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.LoggerInMemory = LoggerInMemory;
|
|
37
|
-
const
|
|
37
|
+
const cache = new CacheInMemory();
|
|
38
|
+
cache.start();
|
|
39
|
+
const loggerInMemory = new LoggerInMemory(cache);
|
|
38
40
|
exports.default = loggerInMemory;
|
|
@@ -27,7 +27,7 @@ class SQSScaledJobRunner {
|
|
|
27
27
|
}
|
|
28
28
|
return JSON.parse(rawMessage);
|
|
29
29
|
}
|
|
30
|
-
async
|
|
30
|
+
async process() {
|
|
31
31
|
let consumedMessages = 0;
|
|
32
32
|
const simultaneity = this.handler.getSimultaneity();
|
|
33
33
|
const timeoutPerMessageSeconds = this.handler.getTimeoutPerMessageSeconds();
|
|
@@ -79,5 +79,12 @@ class SQSScaledJobRunner {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
async run() {
|
|
83
|
+
const promises = [this.process()];
|
|
84
|
+
if (this.options.processTimeoutSeconds) {
|
|
85
|
+
promises.push((0, timeout_1.rejectTimeout)(this.options.processTimeoutSeconds * 1000));
|
|
86
|
+
}
|
|
87
|
+
await Promise.race(promises);
|
|
88
|
+
}
|
|
82
89
|
}
|
|
83
90
|
exports.SQSScaledJobRunner = SQSScaledJobRunner;
|