From 5ec7b6c8f3ebea1e79d55d98345de0ce6b5802a3 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 8 Nov 2017 11:30:53 +0800 Subject: [PATCH] feat(messages): add hnr warning check interval --- config/env/torrents.js | 8 +++++--- .../core/client/controllers/header.client.controller.js | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 605078b0..9279e430 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -507,11 +507,12 @@ module.exports = { * NOTE: you can change these value at anytime if you understand it * * @condition: the condition of HnR warning, user must meet one of them before you receive the warning - * @seedTime: torrent seed time, unit of day, default to 7 days - * @ratio: seed ratio, default to 1.5 + * @seedTime: torrent seed time, unit of day, default to 7 days + * @ratio: seed ratio, default to 1.5 * @forbiddenDownloadMinWarningNumber: when user get this number of warning, then can not to download any torrents, but can continue download the warning status torrent * @scoreToRemoveWarning: if user has any warning, user can remove one warning by score number, if the user has not enough score, user still can remove these * warning by donate the VIP class. + * @checkWaringInterval: set check warning number interval, default 2 minutes */ hitAndRun: { condition: { @@ -519,7 +520,8 @@ module.exports = { ratio: 1.5 }, forbiddenDownloadMinWarningNumber: 3, - scoreToRemoveWarning: 10000 + scoreToRemoveWarning: 10000, + checkWaringInterval: 60 * 1000 * 2 }, /** diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index fcafe39a..acdafa5c 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -15,6 +15,7 @@ vm.language = MeanTorrentConfig.meanTorrentConfig.language; vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce; vm.messageConfig = MeanTorrentConfig.meanTorrentConfig.messages; + vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun; vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app; vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign; vm.accountMenu = menuService.getMenu('account').items[0]; @@ -94,7 +95,7 @@ */ vm.checkHnRWarning = function () { vm.getWarning(); - $interval(vm.getWarning, 120000); + $interval(vm.getWarning, vm.hnrConfig.checkWaringInterval); }; vm.getWarning = function () {