xl: Implement MRF healing (#8470)

This commit is contained in:
Anis Elleuch
2020-01-16 03:30:32 +01:00
committed by Harshavardhana
parent 64fde1ab95
commit 935546d5ca
6 changed files with 168 additions and 28 deletions

View File

@@ -459,15 +459,30 @@ func resetGlobalIsXL() {
// reset global heal state
func resetGlobalHealState() {
// Init global heal state
if globalAllHealState == nil {
return
}
globalAllHealState.Lock()
defer globalAllHealState.Unlock()
for _, v := range globalAllHealState.healSeqMap {
if !v.hasEnded() {
v.stop()
globalAllHealState = initHealState()
} else {
globalAllHealState.Lock()
for _, v := range globalAllHealState.healSeqMap {
if !v.hasEnded() {
v.stop()
}
}
globalAllHealState.Unlock()
}
// Init background heal state
if globalBackgroundHealState == nil {
globalBackgroundHealState = initHealState()
} else {
globalBackgroundHealState.Lock()
for _, v := range globalBackgroundHealState.healSeqMap {
if !v.hasEnded() {
v.stop()
}
}
globalBackgroundHealState.Unlock()
}
}