Is there any method to execute whenever scheduled jobs only when i run "rails server" command?

39 Views Asked by At

I create a whenever scheduled task + ActiveJob job.

I configure config/initializers/scheduler.rb like this:

Rails.application.config.after_initialize do
  ScheduleJobManager.new # 创建定时任务
end

This job will running, no matter what command i type. like rails db:migration, rails server...

I just expected it running when I type "rails server"

0

There are 0 best solutions below