From 5f47ddf153b558876b8ef3cbcb68fbe2daff6698 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 24 Oct 2020 01:14:20 +0800 Subject: [PATCH] server: torrentService: ensure active interval is applied Fixes: aa0c7cf3db7c2c3b997dc7607fd55e1f8f6eaafa --- server/services/torrentService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/services/torrentService.ts b/server/services/torrentService.ts index 7afb80d8..64c313b2 100644 --- a/server/services/torrentService.ts +++ b/server/services/torrentService.ts @@ -41,7 +41,10 @@ class TorrentService extends BaseService { // starts polling when the first streaming listener is added this.on('newListener', (event) => { if (event === 'TORRENT_LIST_DIFF_CHANGE') { - this.pollInterval = config.torrentClientPollInterval; + if (this.pollInterval !== config.torrentClientPollInterval) { + this.pollInterval = config.torrentClientPollInterval; + this.deferFetchTorrentList(); + } } });