commit 296158ce4dc5c25de8889874511df2a3fea229bd
parent 74cb1db22cb6b87f17ed16127f44415875d11509
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Sun, 2 Jun 2024 08:35:21 +0200
log: enhance logging
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/c2ec/proc-retrier.go b/c2ec/proc-retrier.go
@@ -21,9 +21,13 @@ func RunRetrier(ctx context.Context, errs chan error) {
// )
go func() {
+ lastlog := time.Now().Add(time.Minute * -3)
for {
time.Sleep(time.Duration(1000 * time.Millisecond))
- //LogInfo("proc-retrier", "attesting selected withdrawals...")
+ if lastlog.Before(time.Now().Add(time.Second * -30)) {
+ LogInfo("proc-retrier", "attesting selected withdrawals...")
+ lastlog = time.Now()
+ }
withdrawals, err := DB.GetWithdrawalsForConfirmation()
if err != nil {
LogError("proc-retrier", err)
@@ -36,6 +40,7 @@ func RunRetrier(ctx context.Context, errs chan error) {
lastRetryTs = *w.LastRetryTs
}
if ShouldStartRetry(time.Unix(lastRetryTs, 0), int(w.RetryCounter), CONFIG.Server.RetryDelayMs) {
+ LogInfo("proc-retries", "retrying for wopid="+encodeCrock(w.Wopid))
attest(w, errs)
}
}