Skip to content

Commit

Permalink
always set initial health status for every driver
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseakomlo committed Mar 21, 2018
1 parent 127b2c6 commit eb3a53e
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions client/fingerprint_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,17 @@ func (fm *FingerprintManager) setupDrivers(drivers []string) error {
return err
}

// For all drivers without health checking enabled , create a driver
// info which matches its fingerprint status. Later, for drivers that
// have the health check interface implemented, a periodic health check
// will be run
if _, isHealthCheck := d.(fingerprint.HealthCheck); !isHealthCheck {
healthInfo := &structs.DriverInfo{
Healthy: detected,
UpdateTime: time.Now(),
}
if node := fm.updateNodeFromDriver(name, nil, healthInfo); node != nil {
fm.nodeLock.Lock()
fm.node = node
fm.nodeLock.Unlock()
}
// Set the initial health check status to be the driver detected status.
// Later, the periodic health checker will update this value for drivers
// where health checks are enabled.
healthInfo := &structs.DriverInfo{
Healthy: detected,
UpdateTime: time.Now(),
}
if node := fm.updateNodeFromDriver(name, nil, healthInfo); node != nil {
fm.nodeLock.Lock()
fm.node = node
fm.nodeLock.Unlock()
}

// Start a periodic watcher to detect changes to a drivers health and
Expand Down

0 comments on commit eb3a53e

Please sign in to comment.