Skip to content

Commit 8fdf36a

Browse files
committed
fix: remove comments event_aggregator.rs
1 parent 4f33dad commit 8fdf36a

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

sentry/src/event_aggregator.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ impl EventAggregator {
5151
events: &'a [Event],
5252
) -> Result<(), ResponseError>
5353
{
54-
// eventAggrCol
55-
// channelsCol
56-
// try getting aggr if none create and store new aggr
57-
// redis: &MultiplexedConnection,
58-
// session: &Session,
59-
// rate_limit: &RateLimit,
60-
// channel: &Channel,
61-
// events: &[Event]
6254
let has_access = check_access(&app.redis, &session, &app.config.ip_rate_limit, &channel, events).await;
6355
if let Err(e) = has_access {
6456
return Err(ResponseError::BadRequest(e.to_string()));
@@ -74,19 +66,18 @@ impl EventAggregator {
7466
};
7567

7668
// if aggr is none
77-
// spawn a tokio task for saving to database
7869
events.iter().for_each( | ev| event_reducer::reduce(&channel, &mut aggr, ev));
7970
let created = aggr.created;
8071

81-
// drop write access to RwLock and mut access to aggr
82-
// we don't need it anymore
72+
// drop write access to RwLock
73+
// this is required to prevent a deadlock in store
8374
drop(recorder);
8475

8576
if app.config.aggr_throttle > 0
8677
&&
8778
Utc::now() > (created + Duration::seconds(app.config.aggr_throttle as i64))
8879
{
89-
80+
// spawn a tokio task for saving to database
9081
tokio::spawn(
9182
async move {
9283
delay_for(TimeDuration::from_secs(app.config.aggr_throttle as u64)).await;

0 commit comments

Comments
 (0)