LibreOffice: Close stdin right away
This should prevent LibreOffice from hanging if it attempts to read from stdin (it'll get EOF and probably exit with an error instead).
This commit is contained in:
parent
0c31940b09
commit
76374bc489
1 changed files with 2 additions and 1 deletions
|
@ -44,10 +44,11 @@ const doConvertTask = async (task) => {
|
|||
'--outdir',
|
||||
tmpDir,
|
||||
]);
|
||||
soffice.stdin.end();
|
||||
// Soffice/libreoffice is buggy and often hangs.
|
||||
// To remedy this we kill the spawned process after a while.
|
||||
// TODO: Use the timeout option once support for Node.js < v15.13.0 is dropped.
|
||||
const hangTimeout = setTimeout(() => {
|
||||
soffice.stdin.pause(); // required to kill hanging threads
|
||||
soffice.kill();
|
||||
}, 120000);
|
||||
let stdoutBuffer = '';
|
||||
|
|
Loading…
Reference in a new issue