Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/lib/katello/event_daemon/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ def initialize(services)
@services.keys.each do |service_name|
@service_statuses[service_name] = { running: 'starting' }
end
write_statuses_to_cache
end

def start
write_statuses_to_cache
loop do
Rails.application.executor.wrap do
ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
loop do
check_services
sleep 5
end
sleep 15
end
end

Expand Down
3 changes: 2 additions & 1 deletion app/lib/katello/event_daemon/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def start
File.open(lock_file, 'r') do |lockfile|
lockfile.flock(File::LOCK_EX)
return nil if started? # ensure it wasn't started while we waited for the lock
@monitor = Katello::EventDaemon::Monitor.new(@services)
start_monitor_thread
write_pid_file

Expand All @@ -81,7 +82,7 @@ def started?
def start_monitor_thread
@monitor_thread = Thread.new do
Rails.application.executor.wrap do
Katello::EventDaemon::Monitor.new(@services).start
@monitor.start
end
end
end
Expand Down
Loading