control/controlclient: fix accidental backoff reset

Signed-off-by: Kurnia D Win <kurnia.d.win@gmail.com>
This commit is contained in:
Kurnia D Win 2023-03-15 06:45:04 +07:00 committed by Maisem Ali
parent df3996cae3
commit 9526858b1e
1 changed files with 7 additions and 1 deletions

View File

@ -407,7 +407,13 @@ func (c *Auto) authRoutine() {
c.mu.Unlock()
c.sendStatus("authRoutine-url", err, url, nil)
bo.BackOff(ctx, err)
if goal.url == url {
// The server sent us the same URL we already tried,
// backoff to avoid a busy loop.
bo.BackOff(ctx, errors.New("login URL not changing"))
} else {
bo.BackOff(ctx, nil)
}
continue
}