@certik/skynet 0.10.48-beta.2 → 0.10.48
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/CHANGELOG.md +5 -0
- package/deploy.js +5 -3
- package/kafka.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/deploy.js
CHANGED
|
@@ -24,7 +24,9 @@ const INTERVAL_ALIASES = {
|
|
|
24
24
|
function buildEnvTemplate(additionalEnv, isProduction) {
|
|
25
25
|
return Object.keys(additionalEnv)
|
|
26
26
|
.map((key) => {
|
|
27
|
-
return `${key}=${
|
|
27
|
+
return `${key}=${
|
|
28
|
+
additionalEnv[key] ? `"${additionalEnv[key]}"` : getEnvironmentVariableValue(key, isProduction)
|
|
29
|
+
}`;
|
|
28
30
|
})
|
|
29
31
|
.join("\n");
|
|
30
32
|
}
|
|
@@ -34,10 +36,10 @@ function getEnvironmentVariableValue(name, isProduction) {
|
|
|
34
36
|
return `{{key "secrets/${name}" | toJSON}}`;
|
|
35
37
|
} else {
|
|
36
38
|
if (!process.env[name]) {
|
|
37
|
-
return ""
|
|
39
|
+
return `""`;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
return process.env[name]
|
|
42
|
+
return `"${process.env[name]}"`;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
package/kafka.js
CHANGED
|
@@ -5,6 +5,7 @@ const { Kafka, logLevel } = require("kafkajs");
|
|
|
5
5
|
const { getJobName, getSelectorFlags, getSelectorDesc, toSelectorString } = require("./selector");
|
|
6
6
|
const { createRecord, getRecordByKey, deleteRecordsByHashKey } = require("./dynamodb");
|
|
7
7
|
const { exponentialRetry } = require("./availability");
|
|
8
|
+
const { useLock } = require("./distributed-lock");
|
|
8
9
|
const { getBinaryName } = require("./cli");
|
|
9
10
|
const { inline } = require("./log");
|
|
10
11
|
|
|
@@ -218,6 +219,8 @@ ${getSelectorDesc(selector)}
|
|
|
218
219
|
process.exit(0);
|
|
219
220
|
}
|
|
220
221
|
|
|
222
|
+
await useLock({ name: getJobName(name, selectorFlags), ttl: 50, verbose });
|
|
223
|
+
|
|
221
224
|
if (!from) {
|
|
222
225
|
const prevId = await getProducerLatestId(name, selectorFlags);
|
|
223
226
|
|