Skip to content

Commit f280f1a

Browse files
committed
Move to setTimeout and fix the versions of our dependencies.
1 parent 226d68b commit f280f1a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ function createCore(callback) {
6363
function waitForCore(result, callback) {
6464
try {
6565
if(!gencore.checkChild(result.child_pid)) {
66-
// Check on the next tick round the event loop.
67-
setImmediate(waitForCore, result, callback);
66+
// Check again once the file has had a chance to be written.
67+
setTimeout(waitForCore, 10, result, callback);
6868
return;
6969
}
7070
} catch (err) {
7171
setImmediate(callback, err);
7272
return;
7373
}
74-
//console.error('Core file created!');
74+
7575
const work_dir = result.work_dir;
7676
const pid = result.child_pid;
7777

@@ -132,8 +132,8 @@ function collectCore(callback) {
132132
function waitForCoreAndCollect(result, callback) {
133133
try {
134134
if(!gencore.checkChild(result.child_pid)) {
135-
// Check on the next tick round the event loop.
136-
setImmediate(waitForCoreAndCollect, result, callback);
135+
// Check again once the file has had a chance to be written.
136+
setTimeout(waitForCoreAndCollect, 10, result, callback);
137137
// Return so we don't need to indent the rest of
138138
// this function in an else.
139139
return;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"description": "Create a core dump from the currently running process without terminating or attaching a debugger.",
55
"main": "index.js",
66
"dependencies": {
7-
"nan": "^2.3.5",
8-
"fstream": ""
7+
"fstream": "^1.0.11",
8+
"nan": "^2.3.5"
99
},
1010
"devDependencies": {
1111
"tar": "<3.0.0",
12-
"tap": ""
12+
"tap": "^10.5.1"
1313
},
1414
"scripts": {
1515
"test": "tap --timeout=300 test/test*.js"

0 commit comments

Comments
 (0)