We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2468196 + 397d5d5 commit afaec4cCopy full SHA for afaec4c
pkg/perf/healthcheck/ntp.go
@@ -7,6 +7,7 @@ import (
7
"net/http"
8
"time"
9
10
+ "github.com/cenkalti/backoff/v3"
11
"github.com/pkg/errors"
12
"github.com/rs/zerolog/log"
13
"github.com/threefoldtech/zos/pkg/zinit"
@@ -17,8 +18,13 @@ const acceptableSkew = 10 * time.Minute
17
18
func RunNTPCheck(ctx context.Context) {
19
go func() {
20
for {
- if err := ntpCheck(); err != nil {
21
+ exp := backoff.NewExponentialBackOff()
22
+ retryNotify := func(err error, d time.Duration) {
23
log.Error().Err(err).Msg("failed to run ntp check")
24
+ }
25
+
26
+ if err := backoff.RetryNotify(ntpCheck, backoff.WithContext(exp, ctx), retryNotify); err != nil {
27
+ log.Error().Err(err).Send()
28
continue
29
}
30
0 commit comments