@@ -63,15 +63,15 @@ function createCore(callback) {
63
63
function waitForCore ( result , callback ) {
64
64
try {
65
65
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 ) ;
68
68
return ;
69
69
}
70
70
} catch ( err ) {
71
71
setImmediate ( callback , err ) ;
72
72
return ;
73
73
}
74
- //console.error('Core file created!');
74
+
75
75
const work_dir = result . work_dir ;
76
76
const pid = result . child_pid ;
77
77
@@ -132,8 +132,8 @@ function collectCore(callback) {
132
132
function waitForCoreAndCollect ( result , callback ) {
133
133
try {
134
134
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 ) ;
137
137
// Return so we don't need to indent the rest of
138
138
// this function in an else.
139
139
return ;
0 commit comments