cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

commit f65bb25c739b77b33308771e974a778f37199f86
parent 2a24e3a61608cd752fef82b87c5810c9f685c67c
Author: Joel-Haeberli <haebu@rubigen.ch>
Date:   Sun,  2 Jun 2024 09:50:09 +0200

log: enhance logging

Diffstat:
Mc2ec/exponential-backoff.go | 2++
Mc2ec/proc-retrier.go | 1+
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/c2ec/exponential-backoff.go b/c2ec/exponential-backoff.go @@ -5,6 +5,7 @@ import ( "fmt" "math" "math/big" + "strconv" "time" ) @@ -39,6 +40,7 @@ func ShouldStartRetry( now := time.Now().Unix() backoffTime := lastExecution.Unix() + randomizedBackoff + LogInfo("exponential-backoff", fmt.Sprintf("now=%d, backoffTime=%d, shouldStartRetry=%s", now, backoffTime, strconv.FormatBool(now <= backoffTime))) return now <= backoffTime } diff --git a/c2ec/proc-retrier.go b/c2ec/proc-retrier.go @@ -40,6 +40,7 @@ func RunRetrier(ctx context.Context, errs chan error) { 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)) attest(w, errs)