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

Sidekiq/Redis queuing a job that doesn't exist

$
0
0

I built a simple test job for Sidekiq and added it to my schedule.yml file for Sidekiq Cron.

Here's my test job:

module Slack
  class TestJob < ApplicationJob
    queue_as :default

    def perform(*args)
      begin
        SLACK_NOTIFIER.post(attachments: {"pretext": "test", "text": "hello"})
      rescue Exception => error
        puts error
      end
    end
  end
end

The SLACK_NOTIFIER here is a simple API client for Slack that I initialize on startup.

And in my schedule.yml:

test_job:
  cron: "* * * * *"
  class: "Slack::TestJob"
  queue: default
  description: "Test"

So I wanted to have it run every minute, and it worked exactly as I expected.

However, I've now deleted the job file and removed the job from schedule.yml, and it still tries to run the job every minute. I've gone into my sidekiq dashboard, and I see a bunch of retries for that job. No matter how many times I kill them all, they just keep coming.

I've tried shutting down both the redis server and sidekiq several times. I've tried turning off my computer (after killing the servers, of course). It still keeps scheduling these jobs and it's interrupting my other jobs because it raises the following exception:

NameError: uninitialized constant Slack::TestJob

I've done a project-wide search for "TestJob", but get no results.

I only had the redis server open with this job for roughly 10 minutes...

Is there maybe something lingering in the redis database? I've looked into the redis-cli documentation, but I don't think any of it helps me.


Viewing all articles
Browse latest Browse all 873

Trending Articles



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