Fix: public IP loop deadlock

This commit is contained in:
Quentin McGaw (desktop)
2021-09-10 22:54:02 +00:00
parent 8ac2a816c3
commit d39201f9b3
2 changed files with 5 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ package publicip
import (
"context"
"time"
"github.com/qdm12/gluetun/internal/constants"
)
type RestartTickerRunner interface {
@@ -28,7 +30,7 @@ func (l *Loop) RunRestartTicker(ctx context.Context, done chan<- struct{}) {
return
case <-timer.C:
lastTick = l.timeNow()
l.start <- struct{}{}
_, _ = l.ApplyStatus(ctx, constants.Running)
timer.Reset(l.state.GetSettings().Period)
case <-l.updateTicker:
if !timerIsStopped && !timer.Stop() {