commit de9daaf641cd4a4e41e61de6cc3c6eac8913b59c
parent 45fa3790de466484569e69b6321c20a8fb3d948b
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Sun, 2 Jun 2024 09:56:14 +0200
log: enhance logging
Diffstat:
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/c2ec/exponential-backoff.go b/c2ec/exponential-backoff.go
@@ -30,11 +30,6 @@ func ShouldStartRetry(
limitMs int,
) bool {
- if lastExecution.Unix() == 0 {
- // means no retry was done yet.
- return true
- }
-
backoffMs := exponentialBackoffMs(retryCount)
randomizedBackoff := int64(limitMs)
if backoffMs < int64(limitMs) {
diff --git a/c2ec/proc-retrier.go b/c2ec/proc-retrier.go
@@ -39,10 +39,13 @@ func RunRetrier(ctx context.Context, errs chan error) {
var lastRetryTs int64 = 0
if w.LastRetryTs != nil {
lastRetryTs = *w.LastRetryTs
- }
- // TODO -> ShouldStartRetry is buggy
- if ShouldStartRetry(time.Unix(lastRetryTs, 0), int(w.RetryCounter), CONFIG.Server.RetryDelayMs) {
- LogInfo("proc-retries", "retrying for wopid="+encodeCrock(w.Wopid))
+ // TODO -> ShouldStartRetry is buggy
+ if ShouldStartRetry(time.Unix(lastRetryTs, 0), int(w.RetryCounter), CONFIG.Server.RetryDelayMs) {
+ LogInfo("proc-retries", "retrying for wopid="+encodeCrock(w.Wopid))
+ attest(w, errs)
+ }
+ } else {
+ LogInfo("proc-retries", "first try to for confirming wopid="+encodeCrock(w.Wopid))
attest(w, errs)
}
}