mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
LibreOffice: Use async.series
to properly handle conversion errors
This commit is contained in:
parent
a6d5611c80
commit
b914a46a87
1 changed files with 16 additions and 17 deletions
|
@ -110,23 +110,22 @@ exports.convertFile = (srcFile, destFile, type, callback) => {
|
||||||
// to avoid `Error: no export filter for /tmp/xxxx.doc` error
|
// to avoid `Error: no export filter for /tmp/xxxx.doc` error
|
||||||
if (type === 'doc') {
|
if (type === 'doc') {
|
||||||
const intermediateFile = destFile.replace(/\.doc$/, '.odt');
|
const intermediateFile = destFile.replace(/\.doc$/, '.odt');
|
||||||
queue.push({
|
async.series([
|
||||||
|
(callback) => queue.push({
|
||||||
srcFile,
|
srcFile,
|
||||||
destFile: intermediateFile,
|
destFile: intermediateFile,
|
||||||
type: 'odt',
|
type: 'odt',
|
||||||
fileExtension: 'odt',
|
fileExtension: 'odt',
|
||||||
callback: () => {
|
callback,
|
||||||
queue.push(
|
}),
|
||||||
{
|
(callback) => queue.push({
|
||||||
srcFile: intermediateFile,
|
srcFile: intermediateFile,
|
||||||
destFile,
|
destFile,
|
||||||
type,
|
type,
|
||||||
callback,
|
callback,
|
||||||
fileExtension,
|
fileExtension,
|
||||||
}
|
}),
|
||||||
);
|
], callback);
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
queue.push({srcFile, destFile, type, callback, fileExtension});
|
queue.push({srcFile, destFile, type, callback, fileExtension});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue