fix(presence): move sleep in presence cleanup
This commit is contained in:
parent
230f09f8f7
commit
63ac118d11
2 changed files with 3 additions and 2 deletions
|
@ -276,7 +276,7 @@ fn default_presence_offline_timeout() -> u64 {
|
|||
}
|
||||
|
||||
fn default_presence_cleanup_period() -> u64 {
|
||||
24 * 60 * 60
|
||||
1 * 60 * 60
|
||||
}
|
||||
|
||||
fn default_presence_cleanup_limit() -> u64 {
|
||||
|
|
|
@ -306,6 +306,8 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase {
|
|||
|
||||
tokio::spawn(async move {
|
||||
loop {
|
||||
sleep(period).await;
|
||||
|
||||
let mut removed_events: u64 = 0;
|
||||
let age_limit_curr =
|
||||
millis_since_unix_epoch().saturating_sub(age_limit.as_millis() as u64);
|
||||
|
@ -350,7 +352,6 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase {
|
|||
}
|
||||
|
||||
info!("Cleaned up {removed_events} stale presence events!");
|
||||
sleep(period).await;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue