Skip to content

Allow setting redis options - #132

Open
wnm wants to merge 4 commits into
chaps-io:masterfrom
wnm:update-redis-configuration-2
Open

Allow setting redis options#132
wnm wants to merge 4 commits into
chaps-io:masterfrom
wnm:update-redis-configuration-2

Conversation

@wnm

@wnm wnm commented Aug 13, 2025

Copy link
Copy Markdown

No description provided.

@wnm wnm mentioned this pull request Aug 13, 2025
@wnm

wnm commented Aug 13, 2025

Copy link
Copy Markdown
Author

I tried running the specs, but got:

An error occurred while loading ./spec/gush_spec.rb.
Failure/Error: require 'active_support'

NameError:
  uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

🤔

@wnm

wnm commented Oct 6, 2025

Copy link
Copy Markdown
Author

@krzyzak 👀

@pokonski

Copy link
Copy Markdown
Contributor

uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

I think it's because of ruby-concurrency/concurrent-ruby@d7ce956

@pokonski

Copy link
Copy Markdown
Contributor

Weirdly enough this PR has no github actions to run 🤔

@nplusp

nplusp commented Dec 8, 2025

Copy link
Copy Markdown

@wnm @pokonski

Hey folks, I want to use Gush on our project, but we face this issue of not having options for Redis, as say, Sidekiq has.

I've looked in to the issue with specs, and managed to resolve it, by changing rails_version in the Gemfile:

-rails_version = ENV['RAILS_VERSION'] || '< 7.0'
+rails_version = ENV['RAILS_VERSION'] || '<= 8.1'

This allows activesupport 7+ which is compatible with concurrent-ruby >= 1.3.4.
You already do have 8.1 enabled in the gemspec, so this shouldn't be an issue.

@wnm

wnm commented Dec 8, 2025

Copy link
Copy Markdown
Author

thanks @nplusp I updated the Gemfile as you suggested. lets see if that triggers github actions now

@wnm

wnm commented Dec 8, 2025

Copy link
Copy Markdown
Author

thanks @nplusp I updated the Gemfile as you suggested. lets see if that triggers github actions now

ah, the tests run now, but most of them fail with uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger

@nplusp

nplusp commented Dec 8, 2025

Copy link
Copy Markdown

@wnm interesting - I cannot reproduce that issue within you branch. Do you run rspec with prepending bundle exec?

@wnm

wnm commented Dec 8, 2025

Copy link
Copy Markdown
Author

@nplusp yes, it also shows the failing tests in the workflows now: https://github.com/wnm/gush/actions/runs/20033903532

@nplusp

nplusp commented Dec 8, 2025

Copy link
Copy Markdown

Oh yes, another fix would be either to add require "logger" in the lib/gush.rb, or locking the concurrent-ruby to the 1.3.4, as they've dropped the logger support for it ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

ruby-concurrency/concurrent-ruby@d7ce956

https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror

@nplusp

nplusp commented Dec 8, 2025

Copy link
Copy Markdown

I also have noticed a few specs that were failing locally, adding these to reset cached configuration helped:

config.after(:each) do
  clear_enqueued_jobs
  clear_performed_jobs
  redis.flushdb
+  Gush::Client.class_variable_set(:@@redis_connection, Concurrent::ThreadLocalVar.new(nil))
+  Gush.instance_variable_set(:@configuration, nil)
end

The new redis-options spec sets config.redis = { db: 1 }, but the
before(:each) hook only reset redis_url, leaving the redis hash to leak
into later tests. Reset the whole redis hash each example instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wnm

wnm commented May 27, 2026

Copy link
Copy Markdown
Author

@krzyzak fixed tests locally, can you approve the pending workflow here?

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

Successfully merging this pull request may close these issues.

3 participants