Skip to content

BUG: Address broken NEXRAD radar when key expires#8

Merged
cwdaniel merged 1 commit into
mainfrom
nexrad-key-bug-fix
Apr 9, 2026
Merged

BUG: Address broken NEXRAD radar when key expires#8
cwdaniel merged 1 commit into
mainfrom
nexrad-key-bug-fix

Conversation

@cwdaniel

@cwdaniel cwdaniel commented Apr 9, 2026

Copy link
Copy Markdown
Owner

● Summary

  • Fix NEXRAD station data permanently disappearing from Redis after key expiry
  • Root cause: redis.expire() on a non-existent key silently returns 0, so the "data unchanged" path kept refreshing dead keys and skipping re-downloads indefinitely

Changes

  • src/nexrad/redis-scan-store.ts: refreshScanTTL now returns boolean — true if the scan key still exists, false if it has expired
  • src/nexrad/main.ts: When refreshScanTTL returns false, clear latestVolume for that station to force a re-download on the same poll cycle. Stations self-heal within 60
    seconds instead of staying permanently unavailable

Testing

How did you verify this works?

  • npx tsc --noEmit passes
  • Docker builds successfully
  • Tested locally with docker compose up
  • Verified in browser at radrview.com
  • Confirmed docker exec radrview-redis redis-cli keys 'nexrad:status:*' returns empty before fix
  • Confirmed stations recover after docker restart radrview-ingest-nexrad

  Root cause: redis.expire() on a non-existent key returns 0 and silently does nothing. Once the scan keys expired (for any reason — brief network glitch, Redis restart,
  etc.), the "data unchanged" path kept calling expire() on dead keys and skipping the re-download, permanently losing station data.

  Fix: refreshScanTTL now returns whether the scan key actually exists. When it returns false, the ingester clears latestVolume for that station, forcing a re-download on the
   same cycle. This makes NEXRAD keys self-healing — even if they expire, they'll be recreated within one poll cycle (60s).
@cwdaniel
cwdaniel merged commit 8b214f4 into main Apr 9, 2026
1 check passed
@cwdaniel
cwdaniel deleted the nexrad-key-bug-fix branch April 9, 2026 12:27
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