handlers: session_or_hydrate returns the dashmap guard, not Arc
the session index holds values; get() hands back a Ref tied to the map borrow. The Arc-typed helper was a type error on its first CI run.
This commit is contained in:
parent
7089dfb824
commit
9e147093ec
1 changed files with 4 additions and 3 deletions
|
|
@ -4,10 +4,11 @@ use crate::server::SouveraineServer;
|
|||
/// Resolve a session, hydrating from disk when a freshly booted server has
|
||||
/// not loaded this conversation yet. Surfaces hold conversation ids, not a
|
||||
/// map; a restart must answer a held id without a prior listing.
|
||||
async fn session_or_hydrate(
|
||||
server: &SouveraineServer,
|
||||
async fn session_or_hydrate<'a>(
|
||||
server: &'a SouveraineServer,
|
||||
id: &str,
|
||||
) -> Result<Arc<crate::server::session_manager::Session>, ApiError> {
|
||||
) -> Result<dashmap::mapref::one::Ref<'a, String, crate::server::session_manager::Session>, ApiError>
|
||||
{
|
||||
if let Some(session) = server.sessions.get(id) {
|
||||
return Ok(session);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue