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

@@ -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

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() {