Skip to content

Commit

Permalink
Merge pull request #2324 from pulibrary/i2323_upgrade_sidekiq
Browse files Browse the repository at this point in the history
Upgrade Sidekiq and Sidekiq-pro
  • Loading branch information
christinach authored Mar 28, 2024
2 parents 1964624 + cb683e7 commit 391211a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
POSTGRES_USER: bibdata
POSTGRES_DB: bibdata_test
POSTGRES_HOST_AUTH_METHOD: trust
- image: redis:4.0.9-alpine
- image: cimg/redis:7.2
- image: pulibrary/ci-solr:8.4-v2.0.0
command: server/scripts/ci-start.sh

Expand Down
2 changes: 1 addition & 1 deletion .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
type: postgres:13
portforward: true
bibdata_redis:
type: redis:4.0.9
type: redis:7
portforward: true
proxy:
bibdata_test_solr:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
source "https://gems.contribsys.com/" do
gem 'sidekiq-pro', '5.5.5'
gem 'sidekiq-pro'
end

gem 'alma', github: 'tulibraries/alma_rb', branch: 'main'
Expand Down Expand Up @@ -59,7 +59,7 @@ gem 'rubyXL'
gem 'rubyzip', '>= 1.2.2'
gem 'sass-rails'
gem 'selenium-webdriver'
gem 'sidekiq', '<7'
gem 'sidekiq'
gem 'stomp'
gem 'stringex', github: "pulibrary/stringex", tag: 'vpton.2.5.2.2'
gem 'terser'
Expand Down
22 changes: 12 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ GIT
GEM
remote: https://gems.contribsys.com/
specs:
sidekiq-pro (5.5.5)
sidekiq (~> 6.0, >= 6.5.6)
sidekiq-pro (7.2.0)
sidekiq (>= 7.2.0, < 8)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -419,7 +419,7 @@ GEM
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8.1)
rack (2.2.9)
rack-conneg (0.1.6)
rack (>= 1.0)
rack-test (2.1.0)
Expand Down Expand Up @@ -458,7 +458,8 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.1.0)
redis (4.8.1)
redis-client (0.21.1)
connection_pool
regexp_parser (2.9.0)
request_store (1.5.1)
rack (>= 1.4)
Expand Down Expand Up @@ -535,10 +536,11 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (6.5.10)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq (7.2.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.19.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand Down Expand Up @@ -709,8 +711,8 @@ DEPENDENCIES
rubyzip (>= 1.2.2)
sass-rails
selenium-webdriver
sidekiq (< 7)
sidekiq-pro (= 5.5.5)!
sidekiq
sidekiq-pro!
simplecov
solargraph
solr_wrapper
Expand Down
10 changes: 5 additions & 5 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# frozen_string_literal: true

require "redis"
require "redis-client"

# nosemgrep
redis_config = YAML.safe_load(ERB.new(File.read(Rails.root.join("config", "redis.yml"))).result, aliases: true)[Rails.env].with_indifferent_access
redis_client = Redis.new(redis_config.merge(thread_safe: true))._client
redis_config_from_yml = YAML.safe_load(ERB.new(File.read(Rails.root.join("config", "redis.yml"))).result, aliases: true)[Rails.env].with_indifferent_access
redis_config = RedisClient.config(host: redis_config_from_yml[:host], port: redis_config_from_yml[:port], db: redis_config_from_yml[:db])

Sidekiq::Client.reliable_push! unless Rails.env.test?
Sidekiq.configure_server do |config|
config.redis = redis_client.options
config.redis = { url: redis_config.server_url }
config.super_fetch!
config.reliable_scheduler!
end

Sidekiq.configure_client do |config|
config.redis = redis_client.options
config.redis = { url: redis_config.server_url }
end
1 change: 1 addition & 0 deletions config/redis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
development:
host: <%= ENV["lando_bibdata_redis_conn_host"] || "localhost" %>
port: <%= ENV["lando_bibdata_redis_conn_port"] || 6379 %>
db: 1
test:
host: <%= ENV["lando_bibdata_redis_conn_host"] || "localhost" %>
port: <%= ENV["lando_bibdata_redis_conn_port"] || 6379 %>
Expand Down

0 comments on commit 391211a

Please sign in to comment.