简体   繁体   中英

How start clockwork in production environment?

clockwork https://github.com/tomykaira/clockwork

I run following commands in ubuntu production server. Not work.

bin/clockwork clock.rb -e production
bin/clockwork clock.rb RAILS_ENV=production

I run following command in local develop mac. It`s work.

bin/clockwork clock.rb

clock.rb

require 'clockwork'
require_relative './config/boot'
require_relative './config/environment'

module Clockwork
    every(1.day, 'solr.indexing', :at => '02:00') { SolrIndexingJob.perform_later }
end

Suggestion: you can run RAILS_ENV=production rails console and run all codes of clock.rb in console.

and then, you check log/production.log to find "Error"

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