Skip to content

Instantly share code, notes, and snippets.

@troex
Created January 16, 2014 00:47
Show Gist options
  • Save troex/8447776 to your computer and use it in GitHub Desktop.
Save troex/8447776 to your computer and use it in GitHub Desktop.
# automatically spin off additional services in dev mode when `rails s` started
if Rails.env.development? && defined?(Rails::Server)
puts '=> Development mode server detected, spin off additional services'
Thread.new do
puts '=> Starting Delayed::Worker'
Delayed::Worker.new(:quiet => true).start
end
Thread.new do
puts '=> Starting Clockwork'
require File.expand_path('../../../config/schedule.rb', __FILE__)
Clockwork::run
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment