class PygmentsWorker
include Sidekiq::Worker
sidekiq_options queue: "high"
# sidekiq_options retry: false
def perform(snippet_id)
# hard work
end
end
$sidekiq -C config/sidekiq.yml -d -L log/sidekiq.log -P tmp/pids/sidekiq.pid
$rails c
$PygmentsWorker.perform_async(3)
为什么 sidekiq.log 只在sidekiq -C config/sidekiq.yml -d -L log/sidekiq.log -P tmp/pids/sidekiq.pid
时写入,调用PygmentsWorker.perform_async(3)
时不写入任何东西?
sidekiq 异步执行的 code 如何 debugger?