From 17b5e0a52b00c0302f16df8d341483f8aabe97d5 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 4 Oct 2025 16:15:26 -0400 Subject: [PATCH] make cache resilient --- lua/cp/cache.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/cp/cache.lua b/lua/cp/cache.lua index 5794edd..a520a1f 100644 --- a/lua/cp/cache.lua +++ b/lua/cp/cache.lua @@ -86,7 +86,9 @@ function M.get_contest_data(platform, contest_id) contest_id = { contest_id, 'string' }, }) - return cache_data[platform][contest_id] or {} + cache_data[platform] = cache_data[platform] or {} + cache_data[platform][contest_id] = cache_data[platform][contest_id] or {} + return cache_data[platform][contest_id] end ---@param platform string