Skip to content

Commit

Permalink
Add log for rate limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Sep 27, 2024
1 parent c722c8a commit a9ecc47
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/domain/followee_notification_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,15 @@ impl FolloweeNotificationFactory {

let tokens_needed = messages.len() as f64;

// Just to sample the rate limiter
if tokens_needed > 1.0 {
self.rate_limiter.overcharge(tokens_needed);

if let Some(follow_change) = followers.first() {
info!(
"Rate limiter for followee {} after flush: {}",
self.followee.unwrap(),
"Followee {}. {}",
follow_change.friendly_followee(),
self.rate_limiter
);
}

self.rate_limiter.overcharge(tokens_needed);

return messages;
}

Expand Down

0 comments on commit a9ecc47

Please sign in to comment.