Browse Source
Prevent lock issues due to double internal processes
master
meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
1 changed files with
6 additions and
4 deletions
-
src/main/bridge.js
|
|
@ -27,12 +27,17 @@ sentry(() => sentryEnabled, userId) |
|
|
|
const killInternalProcess = () => { |
|
|
|
if (internalProcess) { |
|
|
|
logger.log('killing internal process...') |
|
|
|
internalProcess.removeListener('exit', handleExit) |
|
|
|
internalProcess.kill('SIGINT') |
|
|
|
internalProcess = null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const forkBundlePath = path.resolve(__dirname, `${__DEV__ ? '../../' : './'}dist/internals`) |
|
|
|
const handleExit = code => { |
|
|
|
logger.warn(`Internal process ended with code ${code}`) |
|
|
|
internalProcess = null |
|
|
|
} |
|
|
|
|
|
|
|
const bootInternalProcess = () => { |
|
|
|
logger.log('booting internal process...') |
|
|
@ -45,10 +50,7 @@ const bootInternalProcess = () => { |
|
|
|
}, |
|
|
|
}) |
|
|
|
internalProcess.on('message', handleGlobalInternalMessage) |
|
|
|
internalProcess.on('exit', code => { |
|
|
|
logger.warn(`Internal process ended with code ${code}`) |
|
|
|
internalProcess = null |
|
|
|
}) |
|
|
|
internalProcess.on('exit', handleExit) |
|
|
|
} |
|
|
|
|
|
|
|
process.on('exit', () => { |
|
|
|