diff --git a/lua/cp/race.lua b/lua/cp/race.lua index 689ed41..0e303ee 100644 --- a/lua/cp/race.lua +++ b/lua/cp/race.lua @@ -114,12 +114,13 @@ function M.start(platform, contest_id, language) end function M.stop() - if not race_state.timer then + local timer = race_state.timer + if not timer then logger.log('No active race', vim.log.levels.WARN) return end - race_state.timer:stop() - race_state.timer:close() + timer:stop() + timer:close() race_state.timer = nil race_state.platform = nil race_state.contest_id = nil diff --git a/lua/cp/scraper.lua b/lua/cp/scraper.lua index 216e27e..6c1242d 100644 --- a/lua/cp/scraper.lua +++ b/lua/cp/scraper.lua @@ -33,7 +33,7 @@ end ---@param platform string ---@param subcommand string ---@param args string[] ----@param opts { sync?: boolean, ndjson?: boolean, on_event?: fun(ev: table), on_exit?: fun(result: table) } +---@param opts { sync?: boolean, ndjson?: boolean, on_event?: fun(ev: table), on_exit?: fun(result: table), env_extra?: table, stdin?: string } local function run_scraper(platform, subcommand, args, opts) if not utils.setup_python_env() then local msg = 'no Python environment available (install uv or nix)'