(
State(state): State<Arc<ServerState>>,
Path(id): Path<String>,
)
| 692 | } |
| 693 | |
| 694 | async fn start_compaction( |
| 695 | State(state): State<Arc<ServerState>>, |
| 696 | Path(id): Path<String>, |
| 697 | ) -> Result<Json<SessionInfo>> { |
| 698 | let mut sessions = state.sessions.lock().await; |
| 699 | let session = sessions |
| 700 | .get_mut(&id) |
| 701 | .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?; |
| 702 | session.start_compacting(); |
| 703 | let info = session_to_info(session); |
| 704 | drop(sessions); |
| 705 | persist_sessions_if_enabled(&state).await; |
| 706 | Ok(Json(info)) |
| 707 | } |
| 708 | |
| 709 | #[derive(Debug, Deserialize)] |
| 710 | pub struct SendMessageRequest { |
nothing calls this directly
no test coverage detected