From b219633fc1a2ed85004eb70839ddeed9b5891d44 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 19 Sep 2025 20:44:25 -0400 Subject: [PATCH] fix(ci): undefiend variabe; --- lua/cp/cache.lua | 1 + lua/cp/execute.lua | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lua/cp/cache.lua b/lua/cp/cache.lua index 8d5dd4a..0caf50d 100644 --- a/lua/cp/cache.lua +++ b/lua/cp/cache.lua @@ -24,6 +24,7 @@ local M = {} local cache_file = vim.fn.stdpath('data') .. '/cp-nvim.json' local cache_data = {} +local loaded = false ---@param platform string ---@return number? diff --git a/lua/cp/execute.lua b/lua/cp/execute.lua index ba6a4fe..d336ad8 100644 --- a/lua/cp/execute.lua +++ b/lua/cp/execute.lua @@ -278,6 +278,11 @@ function M.run_problem(ctx, contest_config, is_debug) input_data = table.concat(vim.fn.readfile(ctx.input_file), '\n') .. '\n' end + local cache = require('cp.cache') + cache.load() + local timeout_ms, _ = cache.get_constraints(ctx.contest, ctx.contest_id, ctx.problem_id) + timeout_ms = timeout_ms or 2000 + local run_cmd = build_command(language_config.test, language_config.executable, substitutions) local exec_result = execute_command(run_cmd, input_data, timeout_ms) local formatted_output = format_output(exec_result, ctx.expected_file, is_debug)