Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify replace strategy docs #854

Open
akwiatkowski opened this issue Aug 21, 2024 · 1 comment
Open

clarify replace strategy docs #854

akwiatkowski opened this issue Aug 21, 2024 · 1 comment

Comments

@akwiatkowski
Copy link

Hello.

This is not a clear feature request but a question to clarify docs. https://github.com/mhenrixon/sidekiq-unique-jobs?tab=readme-ov-file#replace "Currently only attempting to retry one time."

I'm not sure but I think retries are matter of sidekiq config, or sidekiq-unique-jobs override number of retries when using replace strategy?

@saiqulhaq
Copy link

in the source code, there is no clear explanation, why it has to be limited to 1 retry

      def call_strategy(origin:)
        new_job_id = nil
        strategy   = strategy_for(origin)
        @attempt  += 1

        strategy.call { new_job_id = lock if strategy.replace? && @attempt < 2 }
        yield if new_job_id && block_given?
      end

lib/sidekiq_unique_jobs/lock/base_lock.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants