Skip to content

Commit

Permalink
feat: add healthchecks bool param to Start()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Selivanov committed May 11, 2023
1 parent 5ac2cfe commit 1d90652
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
type IServicesPool interface {
// Start run service pool discovering
// and healthchecks loops
Start(callback func(srv service.IService) error)
Start(healthchecks bool, callback func(srv service.IService) error)

// DiscoverServices discover all visible active
// services via service-discovery
Expand Down Expand Up @@ -88,9 +88,12 @@ func NewServicesPool(opts *ServicesPoolsOpts) IServicesPool {

// Start run service pool discovering
// and healthchecks loops
func (p *ServicesPool) Start(callback func(srv service.IService) error) {
func (p *ServicesPool) Start(healthchecks bool, callback func(srv service.IService) error) {
go p.discoverServicesLoop(callback)
go p.list.HealthChecksLoop()

if healthchecks {
go p.list.HealthChecksLoop()
}
}

// DiscoverServices discover all visible active
Expand Down

0 comments on commit 1d90652

Please sign in to comment.