Skip to content

Commit

Permalink
Add comment to explain the +2 in the number of iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Oct 22, 2018
1 parent 0ff71d2 commit aee0620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/identity_cache/cache_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aee0620

Please sign in to comment.