(
store: &Arc<dyn SessionStore>,
session_id: &str,
)
| 132 | } |
| 133 | |
| 134 | pub(super) fn load_session_data( |
| 135 | store: &Arc<dyn SessionStore>, |
| 136 | session_id: &str, |
| 137 | ) -> Result<SessionData> { |
| 138 | let data = match tokio::runtime::Handle::try_current() { |
| 139 | Ok(handle) => tokio::task::block_in_place(|| handle.block_on(store.load(session_id))) |
| 140 | .map_err(|e| { |
| 141 | CodeError::Session(format!("Failed to load session {}: {}", session_id, e)) |
| 142 | })?, |
| 143 | Err(_) => { |
| 144 | return Err(CodeError::Session( |
| 145 | "No async runtime available for session resume".to_string(), |
| 146 | )) |
| 147 | } |
| 148 | }; |
| 149 | |
| 150 | data.ok_or_else(|| CodeError::Session(format!("Session not found: {}", session_id))) |
| 151 | } |
| 152 | |
| 153 | pub(super) fn apply_persisted_runtime_options( |
| 154 | mut opts: SessionOptions, |
no test coverage detected