@@ -193,12 +193,12 @@ def edit_with_params(params, endpoints, authentications)
193193 endpoints_changed ||= ems . endpoints . any? ( &:changed? )
194194 authentications_changed ||= ems . authentications . any? ( &:changed? )
195195
196+ after_update_endpoints if endpoints_changed
197+ after_update_authentication if authentications_changed
198+
196199 ems . provider . save! if ems . provider . present? && ems . provider . changed?
197200 ems . save!
198201 end
199-
200- after_update_endpoints if endpoints_changed
201- after_update_authentication if authentications_changed
202202 end
203203 end
204204
@@ -920,14 +920,14 @@ def stop_event_monitor_queue
920920 end
921921
922922 def stop_event_monitor_queue_on_change
923- if event_monitor_class && !self . new_record? && default_endpoint . changed . include_any? ( "hostname" , "ipaddress" )
923+ if event_monitor_class && !new_record? && default_endpoint . changed . include_any? ( "hostname" , "ipaddress" )
924924 _log . info ( "EMS: [#{ name } ], Hostname or IP address has changed, stopping Event Monitor. It will be restarted by the WorkerMonitor." )
925925 stop_event_monitor_queue
926926 end
927927 end
928928
929929 def stop_event_monitor_queue_on_credential_change
930- if event_monitor_class && !self . new_record? && self . credentials_changed ?
930+ if event_monitor_class && !new_record? && default_authentication &. changed ?
931931 _log . info ( "EMS: [#{ name } ], Credentials have changed, stopping Event Monitor. It will be restarted by the WorkerMonitor." )
932932 stop_event_monitor_queue
933933 end
@@ -984,14 +984,14 @@ def stop_refresh_worker_queue
984984 end
985985
986986 def stop_refresh_worker_queue_on_change
987- if refresh_worker_class && !self . new_record? && default_endpoint . changed . include_any? ( "hostname" , "ipaddress" )
987+ if refresh_worker_class && !new_record? && default_endpoint . changed . include_any? ( "hostname" , "ipaddress" )
988988 _log . info ( "EMS: [#{ name } ], Hostname or IP address has changed, stopping Refresh Worker. It will be restarted by the WorkerMonitor." )
989989 stop_refresh_worker_queue
990990 end
991991 end
992992
993993 def stop_refresh_worker_queue_on_credential_change
994- if refresh_worker_class && !self . new_record? && self . credentials_changed ?
994+ if refresh_worker_class && !new_record? && default_authentication &. changed ?
995995 _log . info ( "EMS: [#{ name } ], Credentials have changed, stopping Refresh Worker. It will be restarted by the WorkerMonitor." )
996996 stop_refresh_worker_queue
997997 end
0 commit comments