mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-27 13:03:47 +03:00
fix(presence): check for allow_presence only after services are available
This commit is contained in:
parent
46676267df
commit
8257d0447a
2 changed files with 8 additions and 8 deletions
|
@ -210,6 +210,10 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase {
|
|||
// Wait for services to be created
|
||||
sleep(Duration::from_secs(15)).await;
|
||||
|
||||
if !services().globals.allow_presence() {
|
||||
return;
|
||||
}
|
||||
|
||||
let idle_timeout = Duration::from_secs(services().globals.presence_idle_timeout());
|
||||
let offline_timeout =
|
||||
Duration::from_secs(services().globals.presence_offline_timeout());
|
||||
|
@ -296,6 +300,10 @@ impl service::rooms::edus::presence::Data for KeyValueDatabase {
|
|||
// Wait for services to be created
|
||||
sleep(Duration::from_secs(15)).await;
|
||||
|
||||
if !services().globals.allow_presence() {
|
||||
return;
|
||||
}
|
||||
|
||||
let period = Duration::from_secs(services().globals.presence_cleanup_period());
|
||||
let age_limit = Duration::from_secs(services().globals.presence_cleanup_limit());
|
||||
|
||||
|
|
|
@ -114,18 +114,10 @@ impl Service {
|
|||
&self,
|
||||
timer_receiver: mpsc::UnboundedReceiver<OwnedUserId>,
|
||||
) -> Result<()> {
|
||||
if !services().globals.allow_presence() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.db.presence_maintain(timer_receiver)
|
||||
}
|
||||
|
||||
fn presence_cleanup(&self) -> Result<()> {
|
||||
if !services().globals.allow_presence() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.db.presence_cleanup()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue