Skip to content

Commit 2cc048a

Browse files
Merge pull request #232 from Sebastian-Webster/231-file-watch-stays-active-when-database-exits-before-successfully-starting
stop error log watch when MySQL process closes
2 parents ecdbc75 + 626b43e commit 2cc048a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libraries/Executor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ class Executor {
118118
let resolveFunction: () => void;
119119

120120
process.on('close', async (code, signal) => {
121+
// Prevent open file watches when MySQL has been exited
122+
// The file watch is only stopped if MySQL starts successfully
123+
// This unwatch will prevent the watch from watching when the process has stopped.
124+
fs.unwatchFile(errorLogFile)
125+
121126
if (signal) {
122127
this.logger.log('Exiting because of aborted signal.')
123128
return

0 commit comments

Comments
 (0)