Running Clockwork as a unicorn process to avoid one extra dyno
worker_processes 2 # amount of unicorn workers to spin up
timeout 3000
@resque_pid = nil
@resque_pid2 = nil
before_fork do |server, worker|
@resque_pid ||= spawn("bundle exec rake jobs:work")
@resque_pid2 ||= spawn("bundle exec clockwork app/clock.rb")
end
Disclaimer: I haven't tested this. This bit of code was found on someone else's blog (http://www.nambrot.com/posts/1-heroku-dyno-on-steroids)
Written by Josh Teng
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Unicorn
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#