commit 496c77967d7fbdc050ed978a9ad79709afc38d8d
parent 3269af14a4fdaeb2740a0582f6b5ab8d92372336
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Sun, 2 Jun 2024 11:45:02 +0200
log: enhance logging
Diffstat:
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/c2ec/proc-retrier.go b/c2ec/proc-retrier.go
@@ -13,13 +13,13 @@ const PS_RETRY_CHANNEL = "retry"
func RunRetrier(ctx context.Context, errs chan error) {
- // go RunListener(
- // ctx,
- // PS_RETRY_CHANNEL,
- // retryCallback,
- // make(chan *Notification, RETRY_CHANNEL_BUFFER_SIZE),
- // errs,
- // )
+ go RunListener(
+ ctx,
+ PS_RETRY_CHANNEL,
+ retryCallback,
+ make(chan *Notification, RETRY_CHANNEL_BUFFER_SIZE),
+ errs,
+ )
go func() {
lastlog := time.Now().Add(time.Minute * -3)
@@ -44,7 +44,7 @@ func RunRetrier(ctx context.Context, errs chan error) {
attest(w, errs)
}
} else {
- LogInfo("proc-retries", "first try to for confirming wopid="+encodeCrock(w.Wopid))
+ LogInfo("proc-retrier", "first try confirming wopid="+encodeCrock(w.Wopid))
attest(w, errs)
}
}
@@ -71,8 +71,12 @@ func retryCallback(n *Notification, errs chan error) {
var lastRetryTs int64 = 0
if w.LastRetryTs != nil {
lastRetryTs = *w.LastRetryTs
- }
- if ShouldStartRetry(time.Unix(lastRetryTs, 0), int(w.RetryCounter), CONFIG.Server.RetryDelayMs) {
+ 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-retrier", "first try confirming wopid="+encodeCrock(w.Wopid))
attest(w, errs)
}
}