From 12ac484e78eb32c881330c067230c6a99dba77c8 Mon Sep 17 00:00:00 2001 From: NathanFlurry Date: Fri, 31 May 2024 21:58:16 +0000 Subject: [PATCH] fix(mm): broken cache (#806) ## Changes --- svc/pkg/mm-config/ops/version-get/src/lib.rs | 48 ++++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/svc/pkg/mm-config/ops/version-get/src/lib.rs b/svc/pkg/mm-config/ops/version-get/src/lib.rs index 7faa5c64e5..0333173edc 100644 --- a/svc/pkg/mm-config/ops/version-get/src/lib.rs +++ b/svc/pkg/mm-config/ops/version-get/src/lib.rs @@ -53,27 +53,35 @@ async fn handle( .map(common::Uuid::as_uuid) .collect::>(); - let versions = ctx - .cache() - .immutable() - .fetch_all_proto("versions", req_version_ids, |mut cache, req_version_ids| { - let ctx = ctx.base(); + let versions = fetch_versions(&ctx.base(), req_version_ids) + .await? + .into_iter() + .map(|x| x.1) + .collect::>(); - async move { - fetch_versions(&ctx, req_version_ids) - .await? - .into_iter() - .for_each(|(version_id, version)| { - cache.resolve_with_topic( - &version_id, - version, - ("game_mm_versions", &version_id), - ) - }); - Ok(cache) - } - }) - .await?; + // TODO: There's a bug with this that returns the lobby groups for the wrong + // version, can't figure this out + // let versions = ctx + // .cache() + // .immutable() + // .fetch_all_proto("versions", req_version_ids, |mut cache, req_version_ids| { + // let ctx = ctx.base(); + // + // async move { + // fetch_versions(&ctx, req_version_ids) + // .await? + // .into_iter() + // .for_each(|(version_id, version)| { + // cache.resolve_with_topic( + // &version_id, + // version, + // ("game_mm_versions", &version_id), + // ) + // }); + // Ok(cache) + // } + // }) + // .await?; Ok(mm_config::version_get::Response { versions }) }