From 3e968f6fde73afbe11ab57bbb168054b510d39c1 Mon Sep 17 00:00:00 2001 From: Dmitry Selivanov Date: Thu, 20 Jul 2023 16:11:04 +0200 Subject: [PATCH] fix: existence check before srv add --- services_list.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services_list.go b/services_list.go index da7dafb..a6cdea8 100644 --- a/services_list.go +++ b/services_list.go @@ -172,6 +172,10 @@ func (l *ServicesList) Next() service.IService { // Add service to the list func (l *ServicesList) Add(srv service.IService) { + if l.IsServiceExists(srv) { + return + } + l.mu.Lock() if err := srv.HealthCheck(); err != nil {