Skip to content

Commit

Permalink
Merge pull request #108 from alphagov/fix-reconnect-attempts
Browse files Browse the repository at this point in the history
Fix `reconnect_attempts` not working with Redis 4.8
  • Loading branch information
brucebolt authored Jun 11, 2024
2 parents c73ca2f + 32def77 commit 3312287
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Fix support for `reconnect_attempts` not working with Redis 4.8 (which is required due to the sidekiq version specified)

# 8.0.0

* BREAKING: Drop support for Ruby 3.0. The minimum required Ruby version is now 3.1.4.
Expand Down
1 change: 1 addition & 0 deletions govuk_sidekiq.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "gds-api-adapters", ">= 19.1.0"
spec.add_dependency "govuk_app_config", ">= 1.1"
spec.add_dependency "redis", "< 5"
spec.add_dependency "redis-namespace", "~> 1.6"
spec.add_dependency "sidekiq", "~> 6.5", ">= 6.5.12"

Expand Down
9 changes: 3 additions & 6 deletions lib/govuk_sidekiq/sidekiq_initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ module SidekiqInitializer
def self.setup_sidekiq(govuk_app_name, redis_config = {})
redis_config = redis_config.merge(
namespace: govuk_app_name,
reconnect_attempts: [
0,
15,
30,
60,
],
reconnect_attempts: 4,
reconnect_delay: 15,
reconnect_delay_max: 60,
)

Sidekiq.configure_server do |config|
Expand Down

0 comments on commit 3312287

Please sign in to comment.