mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 23:05:10 +00:00
fix(espn): fetch a window's edge months whole, cap chunk requests per process (#751)
- fetch_espn_date_chunks() asks for a window's partial edge month whole when the window covers ESPN_MONTH_COVER_MIN_DAYS (7) or more of its days, trimmed to the window by US Eastern start date. New espn_request_chunks(). - Chunk requests share one process-wide cap of ESPN_CHUNK_WORKERS (6) in flight. - A new process starts as if a range had just been rejected, so it no longer spends a doomed 400 per window at start. - Also: _eastern_zone() without try/except/pass (Codacy), and test_on_demand_live_and_restore reads the last on-demand state write rather than the last cache write (the font-usage publisher raced it; main CI had failed on it since #748). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -120,8 +120,10 @@ class TestARestoreWithNothingToResume:
|
||||
def test_it_is_reported_as_an_error(self, restored):
|
||||
assert restored.on_demand_status == 'error'
|
||||
assert restored.on_demand_last_error == 'restore-failed'
|
||||
published = restored.cache_manager.set.call_args_list[-1]
|
||||
assert published.args[0] == 'display_on_demand_state'
|
||||
# The last on-demand state write, not the last write of any key: the
|
||||
# font-usage publisher thread writes its own key at its own pace.
|
||||
published = [c for c in restored.cache_manager.set.call_args_list
|
||||
if c.args and c.args[0] == 'display_on_demand_state'][-1]
|
||||
assert published.args[1]['status'] == 'error'
|
||||
assert published.args[1]['error'] == 'restore-failed'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user