mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 11:43:05 +00:00
Do not retry on permission denied in ssh
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
1ecb3e4c2a
commit
10feae2d4b
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,13 @@ var retry = func(times int, sleepInterval time.Duration,
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return result, stderr, nil
|
return result, stderr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we get a permission denied error, we can fail immediately
|
||||||
|
// since that is something we wont recover from by retrying.
|
||||||
|
if err != nil && strings.Contains(stderr, "Permission denied (tailscale)") {
|
||||||
|
return result, stderr, err
|
||||||
|
}
|
||||||
|
|
||||||
time.Sleep(sleepInterval)
|
time.Sleep(sleepInterval)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue