mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
added EMBED_CLOCKWORK so users can embed clockwork scheduling inside another process
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user