fix(config): fixed configure userHnrWarningCheckInterval unit

This commit is contained in:
OldHawk
2018-01-10 10:56:06 +08:00
parent 07216729b9
commit 109d69a9b0
2 changed files with 6 additions and 5 deletions

View File

@@ -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: {

View File

@@ -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) {