ruby-on-rails - Rails 5 gem'delayed_job_active_record'未初始化的常量作业
问题描述
我有两个工作要在生产中运行,一个总是工作正常,但另一个有时会因错误而卡住
uninitialized constant AppointmentReminderJob\nDid you mean?
AppointmentLog\n/Path/shared/bundle/ruby/2.5.0/gems/activesupport-
5.2.4.1/lib/active_support/inflector/methods.rb:283:in
通过生产开始延迟工作RAILS_ENV=production bin/delayed_job restart
在application.rb
集合 config.active_job.queue_adapter = :delayed_job
文件名appointment_reminder_job.rb
class AppointmentReminderJob < ApplicationJob
queue_as :default
def perform(appointment, clinic)
# My code here
end
end
设置作业
AppointmentReminderJob.set(wait_until: Appointment::TIME_LIMIT).perform_later(@appointment, @clinic)
注意:我并不总是但有时会收到此错误。
解决方案
推荐阅读
- c# - SQL 如何替换一个值
- python - 使用 python 和请求,如何进行正确的 POST 调用以及在哪里找到标头?
- android - FirebaseAppDistribution:appDistributionUpload gradle 命令中缺少应用程序 ID
- mysql - 跨列和行计算值的实例
- javascript - 使用 redux 钩子时使用 redux 操作的最佳选择是什么?
- sql - Impala 2.11:AnalysisException:选择列表中不支持子查询
- swift - 在 SwiftUI 中获取当前的经纬度
- c++ - 是否可以禁止一个类被动态转换为?
- git - Git - 将发布分支合并到主分支
- tensorflow - 任何想法如何解决激活函数的问题?