Merge branch 'release/0.8.3-1'

This commit is contained in:
Book Pauk
2020-01-28 21:32:02 +07:00
4 changed files with 15 additions and 7 deletions

View File

@@ -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')

View File

@@ -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);

View File

@@ -37,8 +37,8 @@ class ConvertEpub extends ConvertBase {
await fs.copy(inputFiles.sourceFile, epubFile);
let perc = 0;
await this.execConverter(this.calibrePath, [epubFile, fb2File], () => {
perc = (perc < 100 ? perc + 5 : 50);
await this.execConverter(this.calibrePath, [epubFile, fb2File, '-vv'], () => {
perc = (perc < 100 ? perc + 1 : 50);
callback(perc);
}, abort);

View File

@@ -25,8 +25,8 @@ class ConvertMobi extends ConvertBase {
await fs.copy(inputFiles.sourceFile, mobiFile);
let perc = 0;
await this.execConverter(this.calibrePath, [mobiFile, fb2File], () => {
perc = (perc < 100 ? perc + 5 : 50);
await this.execConverter(this.calibrePath, [mobiFile, fb2File, '-vv'], () => {
perc = (perc < 100 ? perc + 1 : 50);
callback(perc);
}, abort);