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