Skip to content

Commit 7098d89

Browse files
committed
add: update comments
1 parent 8fdf36a commit 7098d89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sentry/src/event_aggregator.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ async fn store(db: &DbPool, channel_id: &ChannelId, aggr: Arc<RwLock<HashMap<Str
3636
if let Some(data) = ev_aggr {
3737
if let Err(e) = insert_event_aggregate(&db, &channel_id, data).await {
3838
eprintln!("{}", e);
39+
return;
3940
};
4041
// reset aggr
4142
recorder.insert(channel_id.to_string(), new_aggr(&channel_id));
@@ -73,6 +74,13 @@ impl EventAggregator {
7374
// this is required to prevent a deadlock in store
7475
drop(recorder);
7576

77+
// Checks if aggr_throttle is set
78+
// and if current time is greater than aggr.created plus throttle seconds
79+
//
80+
// This approach spawns an async task every > AGGR_THROTTLE seconds
81+
// Each spawned task resolves after AGGR_THROTTLE seconds
82+
//
83+
7684
if app.config.aggr_throttle > 0
7785
&&
7886
Utc::now() > (created + Duration::seconds(app.config.aggr_throttle as i64))

0 commit comments

Comments
 (0)