clyops-jobs 0.8.0 → 0.9.0
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/clyops-jobs.cjs +5 -2
- package/package.json +2 -2
package/clyops-jobs.cjs
CHANGED
|
@@ -179,12 +179,13 @@ function stamp(file) {
|
|
|
179
179
|
return `${s.mtimeMs}:${s.size}`;
|
|
180
180
|
}
|
|
181
181
|
var cache = /* @__PURE__ */ new Map();
|
|
182
|
+
var PROBE_TIMEOUT_MS = 3e4;
|
|
182
183
|
function loadSchema(file, opts = {}) {
|
|
183
184
|
const key = stamp(file);
|
|
184
185
|
const hit = cache.get(file);
|
|
185
186
|
if (hit && hit.stamp === key) return hit.schema;
|
|
186
187
|
const schema = new Promise((resolve5, reject) => {
|
|
187
|
-
(0, import_node_child_process.execFile)(file, ["--help-json-schema"], { cwd: opts.cwd, timeout: opts.timeoutMs ??
|
|
188
|
+
(0, import_node_child_process.execFile)(file, ["--help-json-schema"], { cwd: opts.cwd, timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: 16 << 20 }, (err, stdout) => {
|
|
188
189
|
if (err) return reject(new Error(`${file} does not provide --help-json-schema: ${err.message}`));
|
|
189
190
|
const start2 = stdout.indexOf("{");
|
|
190
191
|
const end = stdout.lastIndexOf("}");
|
|
@@ -200,7 +201,9 @@ function loadSchema(file, opts = {}) {
|
|
|
200
201
|
}
|
|
201
202
|
});
|
|
202
203
|
});
|
|
203
|
-
schema.catch(() =>
|
|
204
|
+
schema.catch(() => {
|
|
205
|
+
if (cache.get(file)?.schema === schema) cache.delete(file);
|
|
206
|
+
});
|
|
204
207
|
cache.set(file, { stamp: key, schema });
|
|
205
208
|
return schema;
|
|
206
209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clyops-jobs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Run clyops tools as jobs: config-bound functions, templated invocation, artifacts, job records and a queue.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript": "^5.6.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"clyops-tools": "0.
|
|
41
|
+
"clyops-tools": "0.9.0"
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://clyops.io/node-tools.html",
|
|
44
44
|
"scripts": {
|