added EMBED_CLOCKWORK so users can embed clockwork scheduling inside another process

This commit is contained in:
Sam
2013-07-09 11:01:51 +10:00
parent e993d6b29b
commit 21bfb64a28
3 changed files with 24 additions and 2 deletions

View File

@ -121,6 +121,18 @@ module Discourse
# So open id logs somewhere sane
config.after_initialize do
OpenID::Util.logger = Rails.logger
if ENV['EMBED_CLOCKWORK']
puts ">> Running clockwork in background thread"
require_relative "clock"
Thread.new do
Clockwork.run
end
end
end
end
end