health check
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
This commit is contained in:
@@ -17,6 +17,10 @@ type Quorum interface {
|
||||
OwnerChanged(CartId, host string) error
|
||||
}
|
||||
|
||||
type HealthHandler interface {
|
||||
IsHealthy() bool
|
||||
}
|
||||
|
||||
type RemoteHost struct {
|
||||
*Client
|
||||
Host string
|
||||
@@ -200,6 +204,15 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, discovery Discovery)
|
||||
return pool, nil
|
||||
}
|
||||
|
||||
func (p *SyncedPool) IsHealthy() bool {
|
||||
for _, r := range p.remotes {
|
||||
if r.MissedPings > 3 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *SyncedPool) IsKnown(host string) bool {
|
||||
for _, r := range p.remotes {
|
||||
if r.Host == host {
|
||||
|
||||
Reference in New Issue
Block a user