fix(race): log initial countdown on start (#356)
## Problem Starting a race on a contest more than 1 hour away showed no feedback — `should_notify` only fires at 15-minute intervals, so the first tick produced no message and the UI appeared frozen during the contest list fetch. ## Solution Log the initial countdown immediately after the race timer is set up, before the first `should_notify` tick fires.
This commit is contained in:
parent
926ca587b8
commit
f59c12a929
1 changed files with 9 additions and 0 deletions
|
|
@ -209,6 +209,15 @@ function M.start(platform, contest_id, language)
|
|||
race_state.last_refetch = os.time()
|
||||
race_state.token = token
|
||||
|
||||
logger.log(
|
||||
('%s race "%s" starts in %s'):format(
|
||||
display,
|
||||
race_state.contest_name,
|
||||
format_countdown(remaining)
|
||||
),
|
||||
{ level = vim.log.levels.INFO, override = true }
|
||||
)
|
||||
|
||||
local timer = vim.uv.new_timer()
|
||||
race_state.timer = timer
|
||||
timer:start(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue