mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 20:05:46 +08:00
doing a backwards loop instead
This commit is contained in:
parent
f07a6dcf2f
commit
dbec514d5d
1 changed files with 7 additions and 6 deletions
|
@ -47,12 +47,13 @@ func ManageZombies(ctx context.Context) {
|
||||||
zombies = append(zombies, id)
|
zombies = append(zombies, id)
|
||||||
case id := <-removeZombie:
|
case id := <-removeZombie:
|
||||||
found := false
|
found := false
|
||||||
for i := 0; i < len(zombies); i++ {
|
if len(zombies) > 0 {
|
||||||
if zombies[i] == id {
|
for i := len(zombies) - 1; i <= 0; i-- {
|
||||||
logger.Log(1, "removing zombie from quaratine list", zombies[i])
|
if zombies[i] == id {
|
||||||
zombies = append(zombies[:i], zombies[i+1:]...)
|
logger.Log(1, "removing zombie from quaratine list", zombies[i])
|
||||||
found = true
|
zombies = append(zombies[:i], zombies[i+1:]...)
|
||||||
i--
|
found = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
|
|
Loading…
Add table
Reference in a new issue