Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

NoMethodError: undefined method `jobs' for module Sidekiq::Job

$
0
0

In my event service I'm trying to delete a job, but I see this:

NoMethodError: undefined method `jobs' for module Sidekiq::Job

I know that it is possible to delete using ScheduledSet, but I cannot write tests using it.Service:

# frozen_string_literal: truemodule Api  module V1    module Events      class Destroy < BaseService        attr_reader :event        def initialize(event:)          @event = event        end        def call          cancel_notification          event.destroy          success!(event)        end        private        def cancel_notification          return if event.notification_job_id.blank? || Sidekiq::Worker.jobs.empty?          Sidekiq::Job.jobs.reject! { |job| job["jid"] == event.notification_job_id }        end      end    end  endend

I tried to use Sidekiq::Workers, Sidekiq::Worker(alias) but see the same thing


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>