Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -34,7 +34,7 @@ pub async fn ws(
|
|||||||
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
if let Err(e) = tx.send(BroadcastMessage::StartSyncTaskForUser(
|
||||||
auth.user.user_id.clone(),
|
auth.user.user_id.clone(),
|
||||||
)) {
|
)) {
|
||||||
log::error!("Failed to send StartSyncTaskForUser: {}", e);
|
log::error!("Failed to send StartSyncTaskForUser: {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
let rx = tx.subscribe();
|
let rx = tx.subscribe();
|
||||||
@ -96,7 +96,7 @@ pub async fn ws_handler(
|
|||||||
// Send the message to the websocket
|
// Send the message to the websocket
|
||||||
if let Ok(msg) = serde_json::to_string(&WsMessage::Sync(*event)) {
|
if let Ok(msg) = serde_json::to_string(&WsMessage::Sync(*event)) {
|
||||||
if let Err(e) = session.text(msg).await {
|
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
|
// Close sync task
|
||||||
if let Err(e) = tx.send(BroadcastMessage::StopSyncTaskForUser(user.id.clone())) {
|
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
|
// Invalidate all Ws connections
|
||||||
if let Err(e) = tx.send(BroadcastMessage::CloseAllUserSessions(user.id.clone())) {
|
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());
|
success_message = Some("The client was successfully deleted!".to_string());
|
||||||
|
|
||||||
if let Err(e) = tx.send(BroadcastMessage::CloseClientSession(delete_client_id)) {
|
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()),
|
name: user.name.unwrap_or("no_name".to_string()),
|
||||||
email: user.email.unwrap_or("no@mail.com".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)?;
|
session.insert(USER_SESSION_KEY, user)?;
|
||||||
|
|
||||||
Ok(HttpResponse::Found()
|
Ok(HttpResponse::Found()
|
||||||
|
@ -28,7 +28,7 @@ pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) -> ! {
|
|||||||
continue;
|
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());
|
let task_id = SyncClientID(uuid::Uuid::new_v4());
|
||||||
running_tasks.insert(user_id.clone(), task_id.clone());
|
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) => {
|
BroadcastMessage::StopSyncTaskForUser(user_id) => {
|
||||||
// Check if a task is running for this user
|
// Check if a task is running for this user
|
||||||
if let Some(task_id) = running_tasks.remove(&user_id) {
|
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();
|
tx.send(BroadcastMessage::StopSyncClient(task_id)).unwrap();
|
||||||
} else {
|
} else {
|
||||||
log::info!("Not stopping sync task for user {user_id:?}: not running");
|
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!")
|
log::warn!("The bucket does not seem to exists, trying to create it!")
|
||||||
}
|
}
|
||||||
Err(e) => {
|
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());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user