Git Product home page Git Product logo

Comments (5)

mperham avatar mperham commented on September 24, 2024 1

Oh I see. I'll update the wiki and here asap with the v7 method. I hadn't updated the docs because v7 was still brand new and forgot about it.

from sidekiq.

mperham avatar mperham commented on September 24, 2024

Sidekiq does not use the Redis gem in 7, it only uses redis-client. Can you tell me what redis_info is returning?

from sidekiq.

bryanp avatar bryanp commented on September 24, 2024

So redis_info works fine with redis-client but I get a different error:

NoMethodError: undefined method `mget' for #<RedisClient redis://localhost:6379> (NoMethodError)

          conn.mget(keys).each_with_index do |value, idx|
              ^^^^^
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/api.rb:205:in `block in date_stat_hash'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/config.rb:163:in `block in redis'
	/Users/bryanp/.gem/ruby/3.2.2/gems/redis-client-0.22.1/lib/redis_client/pooled.rb:30:in `block in with'
	/Users/bryanp/.gem/ruby/3.2.2/gems/connection_pool-2.4.1/lib/connection_pool.rb:110:in `block (2 levels) in with'
	/Users/bryanp/.gem/ruby/3.2.2/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `handle_interrupt'
	/Users/bryanp/.gem/ruby/3.2.2/gems/connection_pool-2.4.1/lib/connection_pool.rb:109:in `block in with'
	/Users/bryanp/.gem/ruby/3.2.2/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `handle_interrupt'
	/Users/bryanp/.gem/ruby/3.2.2/gems/connection_pool-2.4.1/lib/connection_pool.rb:106:in `with'
	/Users/bryanp/.gem/ruby/3.2.2/gems/redis-client-0.22.1/lib/redis_client/pooled.rb:26:in `with'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/config.rb:160:in `redis'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq.rb:73:in `redis'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/api.rb:204:in `date_stat_hash'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/api.rb:187:in `processed'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/application.rb:63:in `block in <class:WebApplication>'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/application.rb:416:in `instance_exec'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/application.rb:416:in `block in call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/application.rb:414:in `catch'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/application.rb:414:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/csrf_protection.rb:51:in `admit'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web/csrf_protection.rb:40:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/static.rb:161:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/builder.rb:264:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web.rb:117:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/sidekiq-7.2.4/lib/sidekiq/web.rb:122:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/urlmap.rb:76:in `block in call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/urlmap.rb:60:in `each'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/urlmap.rb:60:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in `context'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/tempfile_reaper.rb:20:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/lint.rb:63:in `response'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/lint.rb:35:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/show_exceptions.rb:27:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/common_logger.rb:43:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rack-3.0.11/lib/rack/content_length.rb:20:in `call'
	/Users/bryanp/.gem/ruby/3.2.2/gems/rackup-2.1.0/lib/rackup/handler/webrick.rb:111:in `service'
	/Users/bryanp/.gem/ruby/3.2.2/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
	/Users/bryanp/.gem/ruby/3.2.2/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
	/Users/bryanp/.gem/ruby/3.2.2/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'

Here's the new code:

require "rack"
require "sidekiq-pro"
require "sidekiq/pro/web"
require "securerandom"
require "rack/urlmap"
require "rack/session"
require "redis-client"

POOL1 = RedisClient.config(url: "redis://localhost:6379/0").new_pool
POOL2 = RedisClient.config(url: "redis://localhost:6379/1").new_pool
use Rack::Session::Cookie, secret: SecureRandom.hex(32), same_site: true, max_age: 86_400
run Rack::URLMap.new(
  "/sidekiq1" => Sidekiq::Pro::Web.with(redis_pool: POOL1),
  "/sidekiq2" => Sidekiq::Pro::Web.with(redis_pool: POOL2),
)

I see Sidekiq::RedisClientAdapter which might be the solve but it isn't immediately clear how to use it.

from sidekiq.

mperham avatar mperham commented on September 24, 2024

Oh, the wiki was updated, did you review it when you got this error?

https://github.com/sidekiq/sidekiq/wiki/Pro-Web-UI#sharding

from sidekiq.

bryanp avatar bryanp commented on September 24, 2024

Nope, I missed that. Fixes my issue!

from sidekiq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.