From aee0620941e6bef68ebd4f61d5a6ebecb925477e Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Mon, 22 Oct 2018 15:48:49 -0400 Subject: [PATCH] Add comment to explain the `+2` in the number of iterations --- lib/identity_cache/cache_fetcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/identity_cache/cache_fetcher.rb b/lib/identity_cache/cache_fetcher.rb index 937956f2..3edb54ec 100644 --- a/lib/identity_cache/cache_fetcher.rb +++ b/lib/identity_cache/cache_fetcher.rb @@ -107,7 +107,7 @@ def fetch_with_fill_lock(key, fill_lock_duration, lock_wait_limit) lock = nil using_fallback_key = false expiration_options = EMPTY_HASH - (lock_wait_limit + 2).times do + (lock_wait_limit + 2).times do # +2 is for first attempt and retry with fallback key result = fetch_or_take_lock(key, old_lock: lock, **expiration_options) case result when FillLock