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: Pass a torrent's infohash to custom chunk stores as the `name` option --- lib/torrent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/torrent.js b/lib/torrent.js index 5f86228..0229e32 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 }) ) -- cgit v1.2.3 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: 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(-) (limited to 'lib') diff --git a/lib/torrent.js b/lib/torrent.js index 0229e32..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 ] -- cgit v1.2.3