Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Aug 20, 2024
1 parent a1f1146 commit ee7f6cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions processes/consumer/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ func Flush(ctx context.Context, inMemDB *models.DatabaseData, dest destination.B
}

start := time.Now()
err = retry.WithRetries(retryCfg, func(_ int, _ error) error {
return flush(ctx, dest, _tableName, _tableData)
})

tags := map[string]string{
"what": "success",
Expand All @@ -94,6 +91,10 @@ func Flush(ctx context.Context, inMemDB *models.DatabaseData, dest destination.B
"reason": args.Reason,
}

err = retry.WithRetries(retryCfg, func(_ int, _ error) error {
return flush(ctx, dest, _tableName, _tableData)
})

if err != nil {
tags["what"] = "merge_fail"
slog.Error(fmt.Sprintf("Failed to %s", action), slog.Any("err", err), slog.String("tableName", _tableName))
Expand Down

0 comments on commit ee7f6cb

Please sign in to comment.