Skip to content

Commit

Permalink
Fix duration format in idempotency protection log (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
amseager authored Sep 13, 2021
1 parent 64b750d commit 266ee72
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,13 @@ private void expireIdempotencyProtection(Instant now) {
totalRecordsDeleted += recordsDeleted;
} while (recordsDeleted > 0);
if (totalRecordsDeleted > 0) {
long s = retentionThreshold.toSeconds();
String duration = String.format("%dd:%02dh:%02dm", s / 3600, (s % 3600) / 60, (s % 60));
String duration =
String.format(
"%dd:%02dh:%02dm:%02ds",
retentionThreshold.toDaysPart(),
retentionThreshold.toHoursPart(),
retentionThreshold.toMinutesPart(),
retentionThreshold.toSecondsPart());
log.info(
"Expired idempotency protection on {} requests completed more than {} ago",
totalRecordsDeleted,
Expand Down

0 comments on commit 266ee72

Please sign in to comment.