Skip to content

Commit

Permalink
refactor: Add status to callbacker logs (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
boecklim authored Dec 2, 2024
1 parent 22fd0dc commit 5de1703
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/callbacker/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (p *CallbackSender) Send(url, token string, dto *Callback) (ok bool) {
slog.String("url", url),
slog.String("token", token),
slog.String("hash", dto.TxID),
slog.String("status", dto.TxStatus),
slog.String("err", err.Error()))
return false
}
Expand All @@ -122,6 +123,7 @@ func (p *CallbackSender) Send(url, token string, dto *Callback) (ok bool) {
slog.String("url", url),
slog.String("token", token),
slog.String("hash", dto.TxID),
slog.String("status", dto.TxStatus),
slog.Int("retries", retries))

p.updateSuccessStats(dto.TxStatus)
Expand All @@ -132,7 +134,8 @@ func (p *CallbackSender) Send(url, token string, dto *Callback) (ok bool) {
slog.String("url", url),
slog.String("token", token),
slog.String("hash", dto.TxID),
slog.Int("retries", p.retries))
slog.String("status", dto.TxStatus),
slog.Int("retries", retries))

p.stats.callbackFailedCount.Inc()
return
Expand Down Expand Up @@ -163,6 +166,7 @@ func (p *CallbackSender) SendBatch(url, token string, dtos []*Callback) (ok bool
slog.String("url", url),
slog.String("token", token),
slog.String("hash", c.TxID),
slog.String("status", c.TxStatus),
slog.Int("retries", retries))

p.updateSuccessStats(c.TxStatus)
Expand All @@ -174,7 +178,7 @@ func (p *CallbackSender) SendBatch(url, token string, dtos []*Callback) (ok bool
slog.String("url", url),
slog.String("token", token),
slog.Bool("batch", true),
slog.Int("retries", p.retries))
slog.Int("retries", retries))

p.stats.callbackFailedCount.Inc()
return
Expand Down

0 comments on commit 5de1703

Please sign in to comment.