Compare commits

..

8 commits

Author SHA1 Message Date
Jacob Taylor
2106e4e9f4 add event_id to log entry 2025-08-26 18:10:08 -07:00
Jacob Taylor
8c8c023120 delete more imports to quiet cargo 2025-08-26 18:10:08 -07:00
Jacob Taylor
5f2a24d7b2 demote a bunch of logs 2025-08-26 18:10:08 -07:00
Jacob Taylor
1934711276 delete a bad event rate limiter (bad, do not use) 2025-08-26 18:10:08 -07:00
Jacob Taylor
1807643371 adjust log volume 2025-08-26 18:10:08 -07:00
Jacob Taylor
6d6593c5eb reduce log volume (keeps 2 infos) 2025-08-26 18:10:08 -07:00
Jacob Taylor
63ee2dacea move more backfill log to info, clean up imports 2025-08-26 18:10:08 -07:00
Jacob Taylor
b8ead96d3e log which room is being backfilled 2025-08-26 18:10:08 -07:00

View file

@ -3,7 +3,11 @@ use std::{
time::Instant,
};
use conduwuit::{Event, PduEvent, debug, debug_error, implement, matrix::event::gen_event_id_canonical_json, trace, utils::continue_exponential_backoff_secs, warn, debug_warn};
use conduwuit::{
Event, PduEvent, debug, debug_error, implement,
matrix::event::gen_event_id_canonical_json, trace, utils::continue_exponential_backoff_secs,
warn,
};
use ruma::{
CanonicalJsonValue, EventId, OwnedEventId, RoomId, ServerName,
api::federation::event::get_event,
@ -66,30 +70,6 @@ where
let mut events_all = HashSet::with_capacity(todo_auth_events.len());
while let Some(next_id) = todo_auth_events.pop_front() {
if let Some((time, tries)) = self
.services
.globals
.bad_event_ratelimiter
.read()
.get(&*next_id)
{
// Exponential backoff
const MIN_DURATION: u64 = 60 * 2;
const MAX_DURATION: u64 = 60 * 60;
if continue_exponential_backoff_secs(
MIN_DURATION,
MAX_DURATION,
time.elapsed(),
*tries,
) {
debug_warn!(
tried = ?*tries,
elapsed = ?time.elapsed(),
"Backing off from {next_id}",
);
continue;
}
}
if events_all.contains(&next_id) {
continue;