mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use the `sidekiq_retry_in` code from Jobs::UserEmail in group SMTP. Also we don't need to keep `seconds_to_delay` -- sidekiq uses the default delay calculation if you return 0 or nil from the block. See3330df0ee3/lib/sidekiq/job_retry.rb (L216-L234)for sidekiq default retry delay logic. I experimented with extracting this into a concern or a module, but `sidekiq_retry_in` is quite magic and it would not allow me to abstract away into a module that calls some method specificall in the child job class. I would love to write tests for this, but it does not seem possible (not sure if its because of our test setup) to write tests that test sidekiq's retry capability, and I am not sure if we should be anyway. Initial addition to UserEmail did not test this functionalityd224966a0e