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

Commit

Permalink
Merge 3a5a111 into e320d5c
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-palmer committed Jan 10, 2019
2 parents e320d5c + 3a5a111 commit fc1c140
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 fc1c140

Please sign in to comment.