mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
all: implement reload command
This commit adds reload command to ctrld for re-fetch new config from ContorlD API or re-read the current config on disk.
This commit is contained in:
committed by
Cuong Manh Le
parent
712b23a4bb
commit
58a00ea24a
@@ -79,13 +79,15 @@ func (p *prog) checkDnsLoop() {
|
||||
}
|
||||
|
||||
// checkDnsLoopTicker performs p.checkDnsLoop every minute.
|
||||
func (p *prog) checkDnsLoopTicker() {
|
||||
func (p *prog) checkDnsLoopTicker(ctx context.Context) {
|
||||
timer := time.NewTicker(time.Minute)
|
||||
defer timer.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-p.stopCh:
|
||||
return
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-timer.C:
|
||||
p.checkDnsLoop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user