Increase download parallelism.
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user