batch-cluster
Advanced tools
Comparing version 5.9.1 to 5.9.2
@@ -20,2 +20,8 @@ # Changelog | ||
## v5.9.2 | ||
- 🐞 `BatchProcess.ready` now verifies the child process still exists | ||
- 📦 Replace tslint with eslint | ||
- 📦 Updated deps | ||
## v5.9.1 | ||
@@ -22,0 +28,0 @@ |
@@ -142,3 +142,3 @@ "use strict"; | ||
// This should only happen in tests. | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
proc_1.end(false, "ended"); | ||
@@ -149,3 +149,3 @@ } | ||
this.emitter.emit("childStart", child_1); | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
proc_1.exitedPromise.then(function () { | ||
@@ -231,3 +231,2 @@ _this._tasksPerProc.push(proc_1.taskCount); | ||
setImmediate(function () { return _this.onIdle(); }); | ||
// tslint:disable-next-line: no-floating-promises | ||
task.promise.then(function () { return _this.onIdle(); }).catch(function () { }); | ||
@@ -389,3 +388,3 @@ return task.promise; | ||
if (reap) { | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
proc.end(true, old ? "old" : wornOut ? "worn" : "broken"); | ||
@@ -411,3 +410,3 @@ } | ||
if (!submitted) { | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
this.enqueueTask(task); | ||
@@ -414,0 +413,0 @@ } |
@@ -125,3 +125,5 @@ "use strict"; | ||
!this.startupTask.pending && | ||
this._endPromise == null); | ||
this._endPromise == null && | ||
this.proc != null && | ||
this.proc.stdin != null); | ||
}, | ||
@@ -198,10 +200,6 @@ enumerable: true, | ||
// milliseconds ago. | ||
if (this.currentTask != null) { | ||
this.observer.onInternalError(new Error(this.name + ".execTask(" + task.command + "): already working on " + this.currentTask)); | ||
if (this._taskCount >= 0 && !this.ready) { | ||
this.observer.onInternalError(new Error(this.name + ".execTask(" + task.command + "): not ready")); | ||
return false; | ||
} | ||
if (this._endPromise != null) { | ||
this.observer.onInternalError(new Error(this.name + ".execTask(" + task.command + "): this process is ending/ended")); | ||
return false; | ||
} | ||
this._taskCount++; | ||
@@ -222,3 +220,3 @@ this.currentTask = task; | ||
// logger().debug(this.name + ".execTask(): starting", { cmd }) | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
task.promise | ||
@@ -241,3 +239,3 @@ .catch(function (err) { | ||
// child process went away. We should too. | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
this.end(false, "proc.stdin.write(cmd)"); | ||
@@ -361,3 +359,2 @@ return false; | ||
if (task.pending) { | ||
// tslint:disable-next-line: no-floating-promises | ||
this.onError("timeout", new Error("waited " + timeoutMs + "ms"), task); | ||
@@ -392,3 +389,3 @@ } | ||
this.clearCurrentTask(); | ||
// tslint:disable-next-line: no-floating-promises | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
this.end(false, "onError(" + source + ")"); | ||
@@ -395,0 +392,0 @@ if (task != null && this.taskCount === 1) { |
{ | ||
"name": "batch-cluster", | ||
"version": "5.9.1", | ||
"version": "5.9.2", | ||
"description": "Manage a cluster of child processes", | ||
@@ -18,6 +18,6 @@ "main": "dist/BatchCluster.js", | ||
"prettier": "prettier --write src/*.ts", | ||
"tslint": "tslint -p . src/*.ts", | ||
"lint": "yarn eslint src --ext .ts", | ||
"compile": "tsc", | ||
"tscw": "rimraf dist & tsc -w", | ||
"pretest": "yarn clean && yarn compile", | ||
"pretest": "yarn clean && yarn lint && yarn compile", | ||
"test": "mocha dist/**/*.spec.js", | ||
@@ -33,11 +33,11 @@ "docs:1": "typedoc --options .typedoc.js", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">= 8" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.2.6", | ||
"@types/chai": "^4.2.7", | ||
"@types/chai-as-promised": "^7.1.2", | ||
"@types/chai-string": "^1.4.2", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.12.14", | ||
"@types/node": "^13.5.0", | ||
"@typescript-eslint/eslint-plugin": "^2.17.0", | ||
"@typescript-eslint/eslint-plugin-tslint": "^2.17.0", | ||
"@typescript-eslint/parser": "^2.17.0", | ||
"chai": "^4.2.0", | ||
@@ -47,15 +47,15 @@ "chai-as-promised": "^7.1.1", | ||
"chai-withintoleranceof": "^1.0.1", | ||
"mocha": "^6.2.2", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.0.0", | ||
"prettier": "^1.19.1", | ||
"rimraf": "^3.0.0", | ||
"seedrandom": "^3.0.5", | ||
"serve": "^11.2.0", | ||
"serve": "^11.3.0", | ||
"source-map-support": "^0.5.16", | ||
"split2": "^3.1.1", | ||
"timekeeper": "^2.2.0", | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.15.3", | ||
"typescript": "^3.7.3", | ||
"wtfnode": "^0.8.0" | ||
"typedoc": "^0.16.9", | ||
"typescript": "^3.7.5", | ||
"wtfnode": "^0.8.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
128881
24
2708