mirror of
https://github.com/daeuniverse/dae.git
synced 2025-03-10 04:47:25 +07:00
optimize: refine reloading
This commit is contained in:
parent
5807a7c11a
commit
d226d799b7
@ -156,12 +156,18 @@ loop:
|
|||||||
} else {
|
} else {
|
||||||
log.Warnln("[Reload] Stopped old control plane")
|
log.Warnln("[Reload] Stopped old control plane")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inject bpf objects into the new control plane life-cycle.
|
// Inject bpf objects into the new control plane life-cycle.
|
||||||
newC.InjectBpf(obj)
|
newC.InjectBpf(obj)
|
||||||
c.Close()
|
|
||||||
|
// Prepare new context.
|
||||||
|
oldC := c
|
||||||
c = newC
|
c = newC
|
||||||
conf = newConf
|
conf = newConf
|
||||||
reloading = true
|
reloading = true
|
||||||
|
|
||||||
|
// Ready to close.
|
||||||
|
oldC.Close()
|
||||||
default:
|
default:
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user