From a556d9ad4eb03ae8a90850a4808546d99a87c73b Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 21 Apr 2016 15:04:03 +0800 Subject: [PATCH] FIX: Expiry should be 3 times polling interval. --- app/jobs/scheduled/poll_mailbox.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb index 44dce2adbf0..e79ad10eddc 100644 --- a/app/jobs/scheduled/poll_mailbox.rb +++ b/app/jobs/scheduled/poll_mailbox.rb @@ -119,7 +119,11 @@ module Jobs end rescue Net::OpenTimeout => e 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 $redis.del(POLL_MAILBOX_TIMEOUT_ERROR_KEY)