@@ -42,7 +42,15 @@ class ConvertBase {
}
try {
- const result = await utils.spawnProcess(path, {args, onData, abort});
+ const result = await utils.spawnProcess(path, {
+ killAfter: 600,
+ args,
+ onData: (data) => {
+ q.resetTimeout();
+ onData(data);
+ },
+ abort
+ });
if (result.code != 0) {
let error = result.code;
if (this.config.branch == 'development')
@@ -22,8 +22,8 @@ class ConvertDocX extends ConvertBase {
async convert(docxFile, fb2File, callback, abort) {
let perc = 0;
- await this.execConverter(this.calibrePath, [docxFile, fb2File], () => {
- perc = (perc < 100 ? perc + 5 : 50);
+ await this.execConverter(this.calibrePath, [docxFile, fb2File, '-vv'], () => {
+ perc = (perc < 100 ? perc + 1 : 50);
callback(perc);
}, abort);
@@ -37,8 +37,8 @@ class ConvertEpub extends ConvertBase {
await fs.copy(inputFiles.sourceFile, epubFile);
- await this.execConverter(this.calibrePath, [epubFile, fb2File], () => {
+ await this.execConverter(this.calibrePath, [epubFile, fb2File, '-vv'], () => {
@@ -25,8 +25,8 @@ class ConvertMobi extends ConvertBase {
await fs.copy(inputFiles.sourceFile, mobiFile);
- await this.execConverter(this.calibrePath, [mobiFile, fb2File], () => {
+ await this.execConverter(this.calibrePath, [mobiFile, fb2File, '-vv'], () => {