From f5ad6d7d8345ff28e9a7d4c4ade6d1490d716f02 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 5 Dec 2018 17:37:36 +0000 Subject: [PATCH] Increase download parallelism. --- src/sidebar.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sidebar.js b/src/sidebar.js index 9798198..ebdf53a 100644 --- a/src/sidebar.js +++ b/src/sidebar.js @@ -53,7 +53,7 @@ class Book{ return fetch(url, { credentials: 'include' }).then((res) => { - console.log(`Downloaded.`) + // console.log(`Downloaded.`) return res; }, onError) } @@ -118,7 +118,7 @@ class Book{ .then((json) => { return this.extractChapterAssets(json) }) - },{concurrency: 1})) + },{concurrency: 10})) return Promise.all(downloads) } @@ -152,13 +152,12 @@ class Book{ return this.downloadResource(url) .then((res) => { if (res.ok){ - console.log(res.headers.get('Content-Type')) this.book_files[url].headers = res.headers this.book_files[url].mime = res.headers.get('Content-Type') this.book_files[url].body = res.blob() } }) - },{concurrency: 1}) + },{concurrency: 10}) } insertBookFile(url, filename){