| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3e11658 commit f0d81c9
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,4 +7,7 @@ process.on('SIGINT', () => { | |||
| 7 | 7 | process.exit(); | |
| 8 | 8 | }); | |
| 9 | 9 | process.send(`script ready ${process.pid}`); | |
| 10 | - setTimeout(() => {}, 100_000); | ||
| 10 | + const timeout = 100_000; | ||
| 11 | + setTimeout(() => { | ||
| 12 | + process._rawDebug(`[CHILD] Timeout ${timeout} fired`); | ||
| 13 | + }, timeout); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,12 @@ child.on('message', (msg) => { | |||
| 51 | 51 | const match = msg.match(/script ready (\d+)/); | |
| 52 | 52 | if (match) { | |
| 53 | 53 | firstGrandchildPid = match[1]; // This is the first grandchild | |
| 54 | - writeFileSync(indexPath, indexContents); | ||
| 54 | + const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing | ||
| 55 | + console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`); | ||
| 56 | + setTimeout(() => { | ||
| 57 | + console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`); | ||
| 58 | + writeFileSync(indexPath, indexContents); | ||
| 59 | + }, writeDelay); | ||
| 55 | 60 | } | |
| 56 | 61 | } | |
| 57 | 62 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,12 @@ child.on('message', (msg) => { | |||
| 52 | 52 | const match = msg.match(/script ready (\d+)/); | |
| 53 | 53 | if (match) { | |
| 54 | 54 | firstGrandchildPid = match[1]; // This is the first grandchild | |
| 55 | - writeFileSync(indexPath, indexContents); | ||
| 55 | + const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing | ||
| 56 | + console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`); | ||
| 57 | + setTimeout(() => { | ||
| 58 | + console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`); | ||
| 59 | + writeFileSync(indexPath, indexContents); | ||
| 60 | + }, writeDelay); | ||
| 56 | 61 | } | |
| 57 | 62 | } | |
| 58 | 63 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments