diff --git a/config/env/torrents.js b/config/env/torrents.js index c18953e2..b20b3a65 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -83,7 +83,7 @@ module.exports = { * @ghostCheck: * @ghostPeersIdleTime: setting idle time more than this value is a ghost peer(died), remove it * @warningCheck: - * @userHnrWarningCheckInterval: setting check users H&R warning interval time, unit of hours, default to 2 + * @userHnrWarningCheckInterval: setting check users H&R warning interval time, default to 2 hours */ announce: { url: '/announce', @@ -108,7 +108,7 @@ module.exports = { ghostPeersIdleTime: 60 * 60 * 1000 * 24 }, warningCheck: { - userHnrWarningCheckInterval: 2 + userHnrWarningCheckInterval: 60 * 60 * 1000 * 2 } }, @@ -123,7 +123,7 @@ module.exports = { * @managingEditor: setting managingEditor info of rss document * @webMaster: setting webMaster info of rss document * @generator: setting generator info of rss document - * @ttl: setting ttl info of rss document + * @ttl: setting ttl info of rss document, unit of seconds * @image_url: setting image_url info of rss document */ rss: { diff --git a/config/lib/cron-job.js b/config/lib/cron-job.js index 0268b708..424df404 100644 --- a/config/lib/cron-job.js +++ b/config/lib/cron-job.js @@ -183,8 +183,9 @@ function removeGhostPeers() { * countUsersHnrWarning */ function countUsersHnrWarning() { + var hours = announceConfig.warningCheck.userHnrWarningCheckInterval / (60 * 60 * 1000); var cronJob = new CronJob({ - cronTime: '00 00 */' + announceConfig.warningCheck.userHnrWarningCheckInterval + ' * * *', + cronTime: '00 00 */' + hours + ' * * *', //cronTime: '*/5 * * * * *', onTick: function () { console.log(chalk.green('countHnrWarning: process!')); @@ -192,7 +193,7 @@ function countUsersHnrWarning() { Complete.find({ complete: true, hnr_warning: false, - refreshat: {$lt: Date.now() - announceConfig.warningCheck.userHnrWarningCheckInterval * 60 * 60 * 1000} + refreshat: {$lt: Date.now() - announceConfig.warningCheck.userHnrWarningCheckInterval} }) .populate('user') .exec(function (err, comps) {