Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Release/v6.2.4 (#97)
Browse files Browse the repository at this point in the history
* Issue #94: restart workers that exit by error or by signal

* Issue #95: fix worker memory leak - delete cluster message callback data after use

* Bumping version to 6.2.4
  • Loading branch information
stephen-palmer authored Jan 10, 2019
1 parent e320d5c commit 545e286
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/cluster_messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ClusterMessages extends EventEmitter {
if(!cb) return;

cb.resolve(message.result);
delete this._callbacks[message.msgId];
});
}
}
Expand Down
10 changes: 10 additions & 0 deletions lib/unity_cache_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ class UnityCacheServer {
for(let i = 0; i < workers; i++) {
cluster.fork();
}

cluster.on('exit', (deadWorker, code, signal) => {
if (signal) {
console.log(`[Cluster: ${deadWorker.id}] !Process killed by signal: ${signal}`);
} else if (code !== 0) {
console.log(`[Cluster: ${deadWorker.id}] !Process exited with error code: ${code}`);
}

cluster.fork();
});
}

if(cluster.isWorker || workers === 0) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-cache-server",
"version": "6.2.3",
"version": "6.2.4",
"description": "Unity Cache Server",
"main": "lib/index.js",
"engines": {
Expand Down

0 comments on commit 545e286

Please sign in to comment.