FIX: Expiry should be 3 times polling interval.

This commit is contained in:
Guo Xiang Tan 2016-04-21 15:04:03 +08:00
parent b4e0c5afe0
commit a556d9ad4e
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ module Jobs
end end
rescue Net::OpenTimeout => e rescue Net::OpenTimeout => e
count = $redis.incr(POLL_MAILBOX_TIMEOUT_ERROR_KEY).to_i count = $redis.incr(POLL_MAILBOX_TIMEOUT_ERROR_KEY).to_i
$redis.expire(POLL_MAILBOX_TIMEOUT_ERROR_KEY, 300) if count == 1
$redis.expire(
POLL_MAILBOX_TIMEOUT_ERROR_KEY,
SiteSetting.pop3_polling_period_mins.minutes * 3
) if count == 1
if count > 3 if count > 3
$redis.del(POLL_MAILBOX_TIMEOUT_ERROR_KEY) $redis.del(POLL_MAILBOX_TIMEOUT_ERROR_KEY)