简体   繁体   中英

Sidekiq with Clockwork triggers but doesn't process job on heroku

Running: sidekiq 2.1.17, rails 3.2.21

I'm trying to use clockwork to schedule some recurring tasks to be done by sidekiq workers. Running foreman in development, everything runs perfectly as scheduled.

When I deploy to heroku, however, I get the "Triggering 'NameWorker.perform_async'" message in the logs at the appropriate times but then the respective jobs don't actually run.

When I instead call NameWorker.perform_async in a controller action, the job runs as it should. The jobs I'm trying to schedule just contain puts statements to verify that they're working. Anyone have any ideas about what I'm doing wrong? Thanks in advance.

Solved by adding the Sidekiq.configure_client logic from the sidekiq.rb file into clock.rb. This logic was already there and in unicorn but sidekiq was not being initialized in production for the purposes of the clockwork process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM