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

Sidekiq not finding records for Rails Active Job

$
0
0

Jobs are queued on after a user is created like so in the model

user.rb

after_create_commit :profile_photo_jobdef profile_photo_job    message = "Add a profile photo"    ReminderJob.set(wait: 1800).perform_later(self.id.to_s, message)end

reminder_job.rb

class ReminderJob < ApplicationJob  queue_as :default  def perform(user_id, message)    if user_id      user = User.find(user_id)    end    ##sending message notification here  endend

However, it often throws the following error inside my sidekiq console

ActiveRecord::RecordNotFound: Couldn't find User with 'id'=7749 Processor: User-MacBook-Pro.local:*****

This error happens in production.


Viewing all articles
Browse latest Browse all 873

Trending Articles



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