diff options
author | Diego RodrÃguez Baquero <diegorbaquero@gmail.com> | 2018-08-29 17:57:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 17:57:28 +0300 |
commit | 06379b5171060716c5b83062e5caa59b6fe1969b (patch) | |
tree | 9cfaf0e7f6774bbf8d0d86dc8e2dc09b01f83db2 /lib/torrent.js | |
parent | 49a005b4e63e56bee1f8b1400f9a2c18bc5ead0a (diff) | |
parent | 1479c3a422f4727f42a06e45269bea6024be262e (diff) |
Merge pull request #1456 from KayleePop/idbkv-chunk-store
File system concurrency in the browser and name passed to the store
Diffstat (limited to 'lib/torrent.js')
-rw-r--r-- | lib/torrent.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 5f86228..610b280 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -45,7 +45,8 @@ const PIPELINE_MAX_DURATION = 1 const RECHOKE_INTERVAL = 10000 // 10 seconds const RECHOKE_OPTIMISTIC_DURATION = 2 // 30 seconds -const FILESYSTEM_CONCURRENCY = 2 +// IndexedDB chunk stores used in the browser benefit from maximum concurrency +const FILESYSTEM_CONCURRENCY = process.browser ? Infinity : 2 const RECONNECT_WAIT = [ 1000, 5000, 15000 ] @@ -459,7 +460,8 @@ class Torrent extends EventEmitter { length: file.length, offset: file.offset })), - length: this.length + length: this.length, + name: this.infoHash }) ) |