Skip to content

Commit

Permalink
refactor: move session allocator to the branch where is used
Browse files Browse the repository at this point in the history
  • Loading branch information
augustoccesar committed Oct 22, 2023
1 parent d2b47d9 commit f0cf5fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions linkup-cli/src/local_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ async fn linkup_config_handler(
string_store: web::Data<MemoryStringStore>,
req_body: web::Bytes,
) -> impl Responder {
let sessions = SessionAllocator::new(string_store.as_ref());

let input_json_conf = match String::from_utf8(req_body.to_vec()) {
Ok(input_json_conf) => input_json_conf,
Err(_) => {
Expand All @@ -35,6 +33,7 @@ async fn linkup_config_handler(

match update_session_req_from_json(input_json_conf) {
Ok((desired_name, server_conf)) => {
let sessions = SessionAllocator::new(string_store.as_ref());
let session_name = sessions
.store_session(server_conf, NameKind::Animal, desired_name)
.await;
Expand Down

0 comments on commit f0cf5fa

Please sign in to comment.