Skip to content

server2: refresh an AirKorea hour while a station lags - #2867

Draft
hwanjjang wants to merge 1 commit into
masterfrom
feat/2614-kma-air-refresh
Draft

hwanjjang wants to merge 1 commit into
masterfrom
feat/2614-kma-air-refresh

Conversation

@hwanjjang

Copy link
Copy Markdown
Collaborator

Summary

AirKorea updates some stations after an hour's nationwide dataset is out. server2 acquired the current hour once, when it was not stored, so those stations answered the previous hour until the next hour's acquisition. On EC2 (2026-11-07) the 02:00 dataset acquired at 02:10 had 둔산동 (Daejeon) and 월영동 (Masan) still at 01:00, and they answered 01:00 until 03:00, about 50 minutes. Legacy collected the real-time observations every 10 minutes.

The observation fold now marks the current hour as lagging when its newest stored dataset has a station one hour behind. The 10-minute capture acquires that hour again, with one key per capture interval so the per-key retry throttle (600 s from the end of the previous acquisition) keeps the cadence. Stations further behind are out of service and never count, so the refreshes stop once every live station is current. Requests answer as before and never wait for a refresh.

Changes

  • air_input.rs: Capture.lagging; observation_fold sets or clears it from the newest dataset of the current hour; the capture loop acquires a lagging hour again with nationwide-{hour}-refresh-{window}.
  • Architecture document: the capture rule.
  • Records: intent/, specs/, plans/issue-2614-kma-air-refresh.md; declaration server2/config/tasks/KMA-AIR-REFRESH.json.

Verification

  • New test the_capture_acquires_the_current_hour_again_while_a_station_lags (stub with 용산구 an hour behind once and a station out of service): Red on master (no refresh in 30 s); 4 of 4 mutations caught (never marked, same key throttled, older rows count, mark never cleared).
  • air_s3 suite 20 passed; full cargo test --locked --workspace 1,214 passed, 0 failed, 7 ignored; cargo fmt --check, cargo clippy -D warnings, placement gate and artifact policy pass.

Daily nationwide calls stay within the legacy cadence's 144 (at most six an hour, only while a station lags). Not in this change: the request path, the AirKorea key quota, and the other fixes of the EC2 report (#2866 is fix 1).

🤖 Generated with Claude Code

AirKorea updates some stations after an hour's nationwide dataset is
out. server2 acquired the current hour once, when it was not stored, so
those stations answered the previous hour until the next hour's
acquisition: on EC2 둔산동 and 월영동 stayed an hour behind for about
50 minutes. Legacy collected every 10 minutes.

The observation fold now marks the current hour as lagging when its
newest stored dataset has a station one hour behind, and the 10-minute
capture acquires that hour again, with one key per capture interval so
the per-key retry throttle keeps the cadence. Stations further behind
are out of service and never count, so the refreshes stop once every
live station is current. Requests answer as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant