From d39201f9b38cfd6bc143a708ca1f096c5ecff52d Mon Sep 17 00:00:00 2001 From: "Quentin McGaw (desktop)" Date: Fri, 10 Sep 2021 22:54:02 +0000 Subject: [PATCH] Fix: public IP loop deadlock --- Dockerfile | 3 ++- internal/publicip/ticker.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a6c1ba0..314bc203 100644 --- a/Dockerfile +++ b/Dockerfile @@ -159,7 +159,8 @@ ENV VPNSP=pia \ SHADOWSOCKS_PASSWORD= \ SHADOWSOCKS_PASSWORD_SECRETFILE=/run/secrets/shadowsocks_password \ SHADOWSOCKS_CIPHER=chacha20-ietf-poly1305 \ - UPDATER_PERIOD=0 + UPDATER_PERIOD=0 \ + PUBLICIP_PERIOD=12h ENTRYPOINT ["/entrypoint"] EXPOSE 8000/tcp 8888/tcp 8388/tcp 8388/udp HEALTHCHECK --interval=5s --timeout=5s --start-period=10s --retries=1 CMD /entrypoint healthcheck diff --git a/internal/publicip/ticker.go b/internal/publicip/ticker.go index 8c93d7f0..8406c2dc 100644 --- a/internal/publicip/ticker.go +++ b/internal/publicip/ticker.go @@ -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() {