mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
LibreOffice: Use the async-provided callback to signal errors
This avoids having two callbacks, which improves readability.
This commit is contained in:
parent
b914a46a87
commit
b321267e66
1 changed files with 4 additions and 9 deletions
|
@ -73,10 +73,7 @@ const doConvertTask = (task, callback) => {
|
|||
libreOfficeLogger.debug(`Renaming ${sourcePath} to ${task.destFile}`);
|
||||
fs.rename(sourcePath, task.destFile, callback);
|
||||
},
|
||||
], (err) => {
|
||||
callback();
|
||||
task.callback(err);
|
||||
});
|
||||
], callback);
|
||||
};
|
||||
|
||||
// Conversion tasks will be queued up, so we don't overload the system
|
||||
|
@ -116,17 +113,15 @@ exports.convertFile = (srcFile, destFile, type, callback) => {
|
|||
destFile: intermediateFile,
|
||||
type: 'odt',
|
||||
fileExtension: 'odt',
|
||||
callback,
|
||||
}),
|
||||
}, callback),
|
||||
(callback) => queue.push({
|
||||
srcFile: intermediateFile,
|
||||
destFile,
|
||||
type,
|
||||
callback,
|
||||
fileExtension,
|
||||
}),
|
||||
}, callback),
|
||||
], callback);
|
||||
} else {
|
||||
queue.push({srcFile, destFile, type, callback, fileExtension});
|
||||
queue.push({srcFile, destFile, type, fileExtension}, callback);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue