Skip to content

Commit

Permalink
fix: existence check before srv add
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Selivanov committed Jul 20, 2023
1 parent c37bd21 commit 3e968f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3e968f6

Please sign in to comment.