Start sync client manager implementation
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::broadcast_messages::BroadcastMessage;
|
||||
use crate::constants::{STATE_KEY, USER_SESSION_KEY};
|
||||
use crate::server::{HttpFailure, HttpResult};
|
||||
use crate::user::{APIClient, APIClientID, User, UserConfig, UserID};
|
||||
@ -10,7 +11,6 @@ use ipnet::IpNet;
|
||||
use light_openid::primitives::OpenIDConfig;
|
||||
use std::str::FromStr;
|
||||
use tokio::sync::broadcast;
|
||||
use crate::broadcast_messages::BroadcastMessage;
|
||||
|
||||
/// Static assets
|
||||
#[derive(rust_embed::Embed)]
|
||||
@ -103,7 +103,10 @@ pub async fn home(
|
||||
config.save().await?;
|
||||
success_message = Some("Matrix token was successfully updated!".to_string());
|
||||
|
||||
// TODO : stop user sync thread
|
||||
// Close sync task
|
||||
if let Err(e) = tx.send(BroadcastMessage::StopSyncTaskForUser(user.id.clone())) {
|
||||
log::error!("Failed to send StopSyncClientForUser: {}", e);
|
||||
}
|
||||
|
||||
// Invalidate all Ws connections
|
||||
if let Err(e) = tx.send(BroadcastMessage::CloseAllUserSessions(user.id.clone())) {
|
||||
|
Reference in New Issue
Block a user