Skip to content

Commit 60b7f9e

Browse files
author
Vladimir Kotikov
committed
Don't force async parsing worker to exit.
This fixes the issue, caused by changed `process.send` behaviour (which became async at one time, so `process.exit` terminates worker before the message will be sent completely). This resolves #61
1 parent 8155233 commit 60b7f9e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/parseJob.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ var fs = require('fs'),
66
fileContents, obj;
77

88
try {
9-
fileContents = fs.readFileSync(path, 'utf-8'),
10-
obj = parser.parse(fileContents)
11-
process.send(obj)
12-
process.exit()
9+
fileContents = fs.readFileSync(path, 'utf-8');
10+
obj = parser.parse(fileContents);
11+
process.send(obj);
1312
} catch (e) {
14-
process.send(e)
15-
process.exit(1)
13+
process.send(e);
14+
process.exitCode = 1;
1615
}

0 commit comments

Comments
 (0)