我正试图从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
...
遵循这里描述的一些指南。我试图要求config/application.rb
在-r
标志下,但没有固定。
删除
- -r # not included in the original setting.
- /app/config/application.rb # not included in the original setting.
- "-C"
- "/app/config/sidekiq.yml"
你需要设置当前工作目录为/app。
最后,我为sidekiq安装了一个不同的卷。
...
command:
- bundle
args:
- exec
- sidekiq
- "-C"
- "/config/sidekiq.yml"
...
volumeMounts:
- name: sidekiq-yml
mountPath: /config