Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make it work #9

Open
md-farhan-memon opened this issue Sep 19, 2023 · 0 comments
Open

Can't make it work #9

md-farhan-memon opened this issue Sep 19, 2023 · 0 comments

Comments

@md-farhan-memon
Copy link

Hi,
I am trying this in my rails project with following details

Sidekiq: v6.5.8
Ruby: v3.1.3
Rails: v7.0.4.3

Sidekiq Config

Sidekiq.configure_server do |config|
    config.redis = REDIS_POOL
    config.error_handlers << Proc.new do |ex, ctx_hash|
      Rails.logger.error('Captured in sidekiq error block')
      Airbrake.notify(ex, ctx_hash)
    end
    SidekiqScheduler::Scheduler.enabled = false

    # ====================== Queue Pause Config =============================
    # https://github.com/projectivetech/sidekiq-queue-pause
    # ====================== Queue Pause Config =============================

    config[:fetch] = Sidekiq::QueuePause::PausingFetch.new(config)

    # Optionally, you may set some unique key identifying the
    # Sidekiq process you want to control. This (server) process will
    # only be paused/unpaused when the function gets called with
    # the corresponding key. See below.
    # Sidekiq::QueuePause.process_key = 'foo'

    # You may also pass in a Proc which is then evaluated when needed.
    # Sidekiq::QueuePause.process_key { SomeClass.some_method }

    # Optionally, you may configure the sleep period (in seconds) after the
    # queue lock has been checked. By default, the fetcher will sleep for
    # Sidekiq::Fetcher::TIMEOUT, i.e. the same time that the redis fetch
    # command may take.
    # Sidekiq::QueuePause.retry_after = 5
  end

Other Sidekiq related dependencies

gem 'sidekiq-limit_fetch', '4.4.1'
gem "sidekiq-bulk"
gem 'sidekiq-scheduler'
gem 'sidekiq-failures'

Here's what I am doing

irb(main):008:0> Sidekiq::QueuePause.paused?(:api_cloudwatch_dashboard_queue)
=> false
irb(main):009:0> Sidekiq::QueuePause.pause(:api_cloudwatch_dashboard_queue)
=> "OK"
irb(main):010:0> Sidekiq::QueuePause.paused?(:api_cloudwatch_dashboard_queue)
=> true

I can see it in UI too...

image

However, when pushing a new task using .perform_async it is getting immediately processed instead of holding back due to pause.

What am I missing 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

No branches or pull requests

1 participant