Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Fix the redis billing update (#39)
Browse files Browse the repository at this point in the history
Turns out we never reset updated.
  • Loading branch information
Ellie Huxtable authored Oct 27, 2023
1 parent 7cd2d61 commit e6ea52f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions capture/src/billing_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ impl BillingLimiter {
//
// This update will block readers! Keep it fast.
if since_update > self.interval {
// open the update lock to change the update, and prevent anyone else from doing so
let mut updated = self.updated.write().await;
*updated = OffsetDateTime::now_utc();

let span = tracing::debug_span!("updating billing cache from redis");
let _span = span.enter();

Expand Down

0 comments on commit e6ea52f

Please sign in to comment.