health check
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s

This commit is contained in:
matst80
2024-11-10 23:20:52 +01:00
parent c5bc17c44d
commit 743849a131
3 changed files with 41 additions and 1 deletions

View File

@@ -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 {