Skip to content

Commit

Permalink
Merge pull request #30 from gateway-fm/fix/existence-check-before-srv…
Browse files Browse the repository at this point in the history
…-add

fix: existence check before srv add
  • Loading branch information
dmitriyselivanov authored Jul 20, 2023
2 parents c37bd21 + 3e968f6 commit 007481d
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 007481d

Please sign in to comment.