Skip to content

Commit 20865e3

Browse files
bazilinskyyclaude
andcommitted
run_channels: a refresh queue entry may carry its own state key (queue_key), for a channel fetched again in a later round
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e372646 commit 20865e3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎run_channels.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,12 @@ def done_before(url, sheet, state):
468468
return (f'row {rows[same[0]]}' if same[0] in rows else same[0]) if same else None
469469

470470

471+
def queue_key(q):
472+
"""The state key of a refresh queue entry: 'refresh:' + its URL, or its own 'key' for a channel fetched again in
473+
a later round (refresh_queue.py --subscriptions-again: phase 7, user 2026-11-28), apart from the round done."""
474+
return q.get('key') or 'refresh:' + q['url']
475+
476+
471477
def refresh_todo(state, args, any_phase=False, only=None):
472478
"""[(None, state key, url, country, new uploads only)] of the channels done before this machine fetches again:
473479
every m-th of the refresh queue (--rows k/m), one started here first; any_phase: of every phase, not only
@@ -486,9 +492,10 @@ def refresh_todo(state, args, any_phase=False, only=None):
486492
except (OSError, ValueError):
487493
taken = set()
488494
for i, q in enumerate(queue):
489-
if 'refresh:' + q['url'] in taken or theirs(q['url'], others):
495+
key = queue_key(q)
496+
if key in taken or theirs(q['url'], others):
490497
continue
491-
key, c = 'refresh:' + q['url'], state.get('refresh:' + q['url'], {})
498+
c = state.get(key, {})
492499
if (c.get('status', 'processing') == 'processing' and not c.get('host')
493500
and (key in state or share is None or i % share[1] == share[0])
494501
and (key in state or any_phase or args.phases is None or q.get('phase') in args.phases)

0 commit comments

Comments
 (0)