From 124fc9fe680f9d13e38b48b5d4ae8cfc3fce0a2a Mon Sep 17 00:00:00 2001 From: KayleePop <34007889+KayleePop@users.noreply.github.com> Date: Sun, 26 Aug 2018 14:28:27 -0500 Subject: [PATCH 1/2] Pass a torrent's infohash to custom chunk stores as the `name` option --- lib/torrent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/torrent.js b/lib/torrent.js index 5f862286..0229e326 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -459,7 +459,8 @@ class Torrent extends EventEmitter { length: file.length, offset: file.offset })), - length: this.length + length: this.length, + name: this.infoHash }) ) From 1479c3a422f4727f42a06e45269bea6024be262e Mon Sep 17 00:00:00 2001 From: KayleePop <34007889+KayleePop@users.noreply.github.com> Date: Sun, 26 Aug 2018 14:33:05 -0500 Subject: [PATCH 2/2] Remove the concurrency limit in the browser IndexedDB chunk stores benefit from maximum concurrency --- lib/torrent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/torrent.js b/lib/torrent.js index 0229e326..610b2806 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 ]