Skip to content

在重试的过程中,有可能别的进程执行了action,写回了缓存。所以应该在重试的时候检查缓存是否存在。 #1

Description

@iamzhangdabei
retries.times do |count|
   return yield if acquire_lock(key, lock_expiry)
   raise MaxRetriesError if count == retries - 1
   exponential_sleep(count) unless count == retries - 1
end

在重试的过程中,有可能别的进程执行了action,写回了缓存。所以应该在重试的时候检查缓存是否存在。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions