Merge pull request #417 from OPNA2608/fix/EPIPE
Deregister prosodyctl interval callback when spawn.stdin disappears
This commit is contained in:
commit
e7d0cdbb30
@ -13,6 +13,7 @@ TODO: tag conversejs livechat branch, and replace commit ID in build-converse.js
|
||||
### Minor changes and fixes
|
||||
|
||||
* Fix cleanup on channel deletion.
|
||||
* #416: Deregister prosodyctl interval callback when spawn.stdin disappears.
|
||||
|
||||
## 10.0.2
|
||||
|
||||
|
@ -165,6 +165,14 @@ async function prosodyCtl (
|
||||
options.peertubeHelpers.logger.debug('ProsodyCtl was called in yesMode, writing to standard input.')
|
||||
spawned.stdin.write('\n')
|
||||
}, 10)
|
||||
spawned.stdin.on('close', () => {
|
||||
options.peertubeHelpers.logger.debug('ProsodyCtl standard input closed, clearing interval.')
|
||||
clearInterval(yesModeInterval)
|
||||
})
|
||||
spawned.stdin.on('error', () => {
|
||||
options.peertubeHelpers.logger.debug('ProsodyCtl standard input errored, clearing interval.')
|
||||
clearInterval(yesModeInterval)
|
||||
})
|
||||
}
|
||||
|
||||
spawned.stdout.on('data', (data) => {
|
||||
@ -186,7 +194,6 @@ async function prosodyCtl (
|
||||
// on 'close' and not 'exit', to be sure everything is done
|
||||
// (else it can cause trouble by cleaning AppImage extract too soon)
|
||||
spawned.on('close', (code) => {
|
||||
if (yesModeInterval) { clearInterval(yesModeInterval) }
|
||||
resolve({
|
||||
code: code,
|
||||
stdout: d,
|
||||
|
Loading…
Reference in New Issue
Block a user