Skip to content

Commit

Permalink
Don't be lazy with regard to time computation
Browse files Browse the repository at this point in the history
Guess what is lazy in its argument! Turns out, unwrap_or_else does
not evaluate its closure immediately but only at-need. This means
that when we have a back-up in reporting we do not backfill
correctly.

Womp womp

Signed-off-by: Brian L. Troutwine <blt@postmates.com>
  • Loading branch information
Brian L. Troutwine committed Aug 9, 2016
1 parent b7f1927 commit 9ba7aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Metric {
name: name,
value: value,
kind: kind,
time: time.unwrap_or_else(UTC::now),
time: time.unwrap_or(UTC::now()),
}
}

Expand Down

0 comments on commit 9ba7aa0

Please sign in to comment.