我正在尝试从Delayed_Job迁移到Sidekiq。在kubernetes中运行Sidekiq时,出现了一个无法识别的错误:
==================================================================
Please point Sidekiq to a Rails application or a Ruby file
to load your job classes with -r [DIR|FILE].
==================================================================
Kubernetes部署代码段:
...
containers:
- name: sidekiq
image: {{ application_registry }}
imagePullPolicy: Always
command:
- bundle
args:
- exec
- sidekiq
- -r # not included in the original setting.
- /app/config/application.rb # not included in the original setting.
- "-C"
- "/app/config/sidekiq.yml"
resources:
...
PS:很多现有的作业仍然依赖DelayJob,有些我们计划逐步迁移。所以我们包括每个作业的Sidekiq,而不是全局:
class FirstJob < ApplicationJob
self.queue_adapter = :sidekiq
...
按照一些指南描述的Here。我试图要求在-r
标志下的config/application.rb
,但没有修复。
1条答案
按热度按时间mzillmmw1#
摆脱
您需要将当前工作目录设置为/app。