mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-06 06:18:04 +02:00
fix(config): fixed configure userHnrWarningCheckInterval unit
This commit is contained in:
6
config/env/torrents.js
vendored
6
config/env/torrents.js
vendored
@@ -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: {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user