fix: refactor background heal for cluster health (#10225)

This commit is contained in:
Harshavardhana
2020-08-07 19:43:06 -07:00
committed by GitHub
parent 8049184dcc
commit 2a9819aff8
9 changed files with 91 additions and 70 deletions
+8 -1
View File
@@ -802,8 +802,15 @@ func (a adminAPIHandlers) HealHandler(w http.ResponseWriter, r *http.Request) {
func getAggregatedBackgroundHealState(ctx context.Context, failOnErr bool) (madmin.BgHealState, error) {
var bgHealStates []madmin.BgHealState
localHealState, ok := getLocalBackgroundHealStatus()
if !ok {
if failOnErr {
return madmin.BgHealState{}, errServerNotInitialized
}
}
// Get local heal status first
bgHealStates = append(bgHealStates, getLocalBackgroundHealStatus())
bgHealStates = append(bgHealStates, localHealState)
if globalIsDistErasure {
// Get heal status from other peers