Compare commits
2 Commits
036118d737
...
e1b0c9563f
Author | SHA1 | Date | |
---|---|---|---|
e1b0c9563f | |||
5e84b40d05 |
17
Cargo.lock
generated
17
Cargo.lock
generated
@ -1808,6 +1808,17 @@ dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "io-uring"
|
||||
version = "0.7.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipnet"
|
||||
version = "2.11.0"
|
||||
@ -3476,17 +3487,19 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.45.1"
|
||||
version = "1.46.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
|
||||
checksum = "1140bb80481756a8cbe10541f37433b459c5aa1e727b4c020fbfebdc25bf3ec4"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
"io-uring",
|
||||
"libc",
|
||||
"mio",
|
||||
"parking_lot",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"slab",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"windows-sys 0.52.0",
|
||||
|
@ -32,4 +32,4 @@ sha2 = "0.11.0-rc.0"
|
||||
base16ct = "0.2.0"
|
||||
ruma = { version = "0.12.3", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
||||
actix-ws = "0.3.0"
|
||||
tokio = { version = "1.45.1", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
||||
tokio = { version = "1.46.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
@ -34,7 +34,7 @@ pub async fn ws(
|
||||
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
||||
auth.user.user_id.clone(),
|
||||
)) {
|
||||
log::error!("Failed to send StartSyncTaskForUser: {}", e);
|
||||
log::error!("Failed to send StartSyncTaskForUser: {e}");
|
||||
}
|
||||
|
||||
let rx = tx.subscribe();
|
||||
@ -96,7 +96,7 @@ pub async fn ws_handler(
|
||||
// Send the message to the websocket
|
||||
if let Ok(msg) = serde_json::to_string(&WsMessage::Sync(*event)) {
|
||||
if let Err(e) = session.text(msg).await {
|
||||
log::error!("Failed to send SyncEvent: {}", e);
|
||||
log::error!("Failed to send SyncEvent: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -105,12 +105,12 @@ pub async fn home(
|
||||
|
||||
// Close sync task
|
||||
if let Err(e) = tx.send(BroadcastMessage::StopSyncTaskForUser(user.id.clone())) {
|
||||
log::error!("Failed to send StopSyncClientForUser: {}", e);
|
||||
log::error!("Failed to send StopSyncClientForUser: {e}");
|
||||
}
|
||||
|
||||
// Invalidate all Ws connections
|
||||
if let Err(e) = tx.send(BroadcastMessage::CloseAllUserSessions(user.id.clone())) {
|
||||
log::error!("Failed to send CloseAllUserSessions: {}", e);
|
||||
log::error!("Failed to send CloseAllUserSessions: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -145,7 +145,7 @@ pub async fn home(
|
||||
success_message = Some("The client was successfully deleted!".to_string());
|
||||
|
||||
if let Err(e) = tx.send(BroadcastMessage::CloseClientSession(delete_client_id)) {
|
||||
log::error!("Failed to send CloseClientSession: {}", e);
|
||||
log::error!("Failed to send CloseClientSession: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ pub async fn oidc_cb(session: Session, query: web::Query<AuthCallbackQuery>) ->
|
||||
name: user.name.unwrap_or("no_name".to_string()),
|
||||
email: user.email.unwrap_or("no@mail.com".to_string()),
|
||||
};
|
||||
log::info!("Successful authentication as {:?}", user);
|
||||
log::info!("Successful authentication as {user:?}");
|
||||
session.insert(USER_SESSION_KEY, user)?;
|
||||
|
||||
Ok(HttpResponse::Found()
|
||||
|
@ -28,7 +28,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
||||
continue;
|
||||
}
|
||||
|
||||
log::info!("Start sync task for user {:?}", user_id);
|
||||
log::info!("Start sync task for user {user_id:?}");
|
||||
let task_id = SyncClientID(uuid::Uuid::new_v4());
|
||||
running_tasks.insert(user_id.clone(), task_id.clone());
|
||||
|
||||
@ -41,7 +41,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
||||
BroadcastMessage::StopSyncTaskForUser(user_id) => {
|
||||
// Check if a task is running for this user
|
||||
if let Some(task_id) = running_tasks.remove(&user_id) {
|
||||
log::info!("Stop sync task for user {:?}", user_id);
|
||||
log::info!("Stop sync task for user {user_id:?}");
|
||||
tx.send(BroadcastMessage::StopSyncClient(task_id)).unwrap();
|
||||
} else {
|
||||
log::info!("Not stopping sync task for user {user_id:?}: not running");
|
||||
|
@ -147,7 +147,7 @@ impl UserConfig {
|
||||
log::warn!("The bucket does not seem to exists, trying to create it!")
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Got unexpected error when querying bucket info: {}", e);
|
||||
log::error!("Got unexpected error when querying bucket info: {e}");
|
||||
return Err(e.into());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user