M #-: subscribe to service changes

This commit is contained in:
Alejandro Huertas committed 2020-05-18 18:28:07 +02:00
1 parent 13f6ea8684
commit 181cdce470
2 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -91,7 +91,7 @@ class ServiceLCM
Thread.new do
wd = ServiceWD.new(client, em_conf)
wd.start @srv_pool
wd.start(@srv_pool)
end
Thread.new do
+6 -2
View File
@@ -62,6 +62,8 @@ class ServiceWD
def start(service_pool)
Log.info LOG_COMP, 'Start watch dog'
service_pool.info_all
# check that all nodes are in RUNNING state, if not, notify
check_roles_state(client, service_pool)
@@ -161,10 +163,12 @@ class ServiceWD
# @param service_id [Integer] Service ID to check
# @param roles [Array] Service roles with its nodes
def check_roles_state(client, service_pool)
service_pool.each do |service|
service_pool.each do |service|
service.info
service.roles.each do |name, role|
role.nodes_ids.each do |node|
check_role_state(client, service_id, name, node)
check_role_state(client, service.id, name, node)
end
end
end