mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
chore(dns): update filter block lists without restarting DNS server
This commit is contained in:
+2
-13
@@ -28,22 +28,11 @@ func (l *Loop) RunRestartTicker(ctx context.Context, done chan<- struct{}) {
|
|||||||
return
|
return
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
lastTick = l.timeNow()
|
lastTick = l.timeNow()
|
||||||
|
if l.GetStatus() == constants.Running {
|
||||||
status := l.GetStatus()
|
|
||||||
if status == constants.Running {
|
|
||||||
if err := l.updateFiles(ctx); err != nil {
|
if err := l.updateFiles(ctx); err != nil {
|
||||||
l.statusManager.SetStatus(constants.Crashed)
|
l.logger.Warn("updating block lists failed, skipping: " + err.Error())
|
||||||
l.logger.Error(err.Error())
|
|
||||||
l.logger.Warn("skipping DNS server restart due to failed files update")
|
|
||||||
settings := l.GetSettings()
|
|
||||||
timer.Reset(*settings.UpdatePeriod)
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _ = l.statusManager.ApplyStatus(ctx, constants.Stopped)
|
|
||||||
_, _ = l.statusManager.ApplyStatus(ctx, constants.Running)
|
|
||||||
|
|
||||||
settings := l.GetSettings()
|
settings := l.GetSettings()
|
||||||
timer.Reset(*settings.UpdatePeriod)
|
timer.Reset(*settings.UpdatePeriod)
|
||||||
case <-l.updateTicker:
|
case <-l.updateTicker:
|
||||||
|
|||||||
Reference in New Issue
Block a user