Project

General

Profile

« Previous | Next » 

Revision b58a527e

Added by Ivan Necas almost 10 years ago

Fixes #6283 - Use the Dynflow API to find out if the foreman_tasks is running

Instead of spawning process to find out the katello jobs was running

View differences:

app/models/katello/ping.rb
:elasticsearch => {},
:pulp_auth => {},
:candlepin_auth => {},
:katello_jobs => {},
:foreman_tasks => {},
}}
else
result = { :status => OK_RETURN_CODE, :services => {
:candlepin => {},
:elasticsearch => {},
:candlepin_auth => {},
:katello_jobs => {},
:foreman_tasks => {},
:thumbslug => {}
}}
end
......
Katello::Resources::Candlepin::CandlepinPing.ping
end
# katello jobs - TODO we should not spawn processes
exception_watch(result[:services][:katello_jobs]) do
fail _("katello-jobs service not running") unless system("/sbin/service katello-jobs status")
exception_watch(result[:services][:foreman_tasks]) do
dynflow_world = ForemanTasks.dynflow.world
if dynflow_world.executor.is_a?(Dynflow::Executors::RemoteViaSocket) &&
!dynflow_world.executor.connected?
fail _("foreman-tasks service not running")
end
end
# set overall status result code

Also available in: Unified diff