resque/resque-scheduler

enqueue_at not working

seb-sykio opened this issue · 4 comments

hi,
when I use
Resque.enqueue_at(10.seconds.from_now, SendMailJob, :my_id => id)
my job is correctly added to delayed job, then it is added to default queue, then I can see in resque-web that it has been counted as a success but I dont receive any mail
If I do
SendMailJob.perform_later(:my_id => id)

then I receive a mail.

my job:

class SendMailJob < ActiveJob::Base
  queue_as :default
  
  def self.queue
    :default
  end

  def perform(params)
    user = User.find(params[:id])
    ...
  end
end

Im also using gem active_scheduler
what am I doing wrong ?

What ActionMailer delivery method are you calling in your job? Are you using deliver_now?

yes I use deliver_now, but anyway, with log I can clearly see that "perform" method is not called at all

I'm seeing this same behavior. Haven't found a solution yet.

Running rake environment resque:scheduler instead of rake resque:scheduler resolved this for me.