Maint: use loopstate for httpproxy

This commit is contained in:
Quentin McGaw (desktop)
2021-07-23 20:47:36 +00:00
parent 72a5e1f695
commit 7e343d7006
6 changed files with 83 additions and 120 deletions

View File

@@ -14,7 +14,7 @@ func (l *looper) Run(ctx context.Context, done chan<- struct{}) {
if l.GetSettings().Enabled {
go func() {
_, _ = l.SetStatus(ctx, constants.Running)
_, _ = l.statusManager.ApplyStatus(ctx, constants.Running)
}()
}
@@ -40,7 +40,7 @@ func (l *looper) Run(ctx context.Context, done chan<- struct{}) {
crashed = false
} else {
l.backoffTime = defaultBackoffTime
l.state.setStatusWithLock(constants.Running)
l.statusManager.SetStatus(constants.Running)
}
stayHere := true
@@ -61,7 +61,7 @@ func (l *looper) Run(ctx context.Context, done chan<- struct{}) {
<-errorCh
l.stopped <- struct{}{}
case err := <-errorCh:
l.state.setStatusWithLock(constants.Crashed)
l.statusManager.SetStatus(constants.Crashed)
l.logAndWait(ctx, err)
crashed = true
stayHere = false