Мелкие поправки

This commit is contained in:
Book Pauk
2019-01-13 00:46:30 +07:00
parent 5c550ed141
commit 75487c38f6

View File

@@ -13,10 +13,13 @@ const download = require('download');
class ReaderWorker {
constructor(config) {
this.config = Object.assign({}, config);
this.config.tempDownloadDir = `${config.tempDir}/download`;
fs.ensureDirSync(this.config.tempDownloadDir);
this.config.tempPublicDir = `${config.publicDir}/tmp`;
fs.ensureDirSync(this.config.tempPublicDir);
this.detector = new FileDetector();
this.decomp = new FileDecompressor();
this.bookConverter = new BookConverter();
@@ -62,9 +65,12 @@ class ReaderWorker {
});
wState.set({progress: 100});
wState.finish({file: `/tmp/${tempFilename2}`});
//finish
wState.finish({path: `/tmp/${tempFilename2}`});
} catch (e) {
wState.set({state: 'error', error: (errMes ? errMes : e.message)});
} finally {
//clean
if (decompDir)