Skip to content

fix doubled "waiting for manual poll" log on every poll cycle - #734

Merged
ajslater merged 1 commit into
developfrom
claude/compassionate-chaum-872bad
May 7, 2026
Merged

ajslater merged 1 commit into
developfrom
claude/compassionate-chaum-872bad

Conversation

@ajslater

@ajslater ajslater commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • The poller's main loop iterates all libraries twice per cycle whenever any library is due — first via _get_min_timeout to find the soonest due library, then via _poll_due_libraries to actually poll them.
  • Both call _get_poll_timeout, and that helper emits an INFO line Library X waiting for manual poll. as a side effect for every poll=False library it sees. So the line shows up twice every hour for the custom-covers library.
  • Folded the two passes into _poll_due_and_get_next_timeout, which polls each due library inline and folds its post-poll poll_every into the running min. Each library is now inspected exactly once per cycle.

Production log evidence (note the duplicated lines):

2026-05-05 14:36:33 | DEBUG    | Move Folders: ?/3
2026-05-05 14:36:33 | INFO     | Polled library /comics in a moment.
2026-05-05 14:36:33 | INFO     | Library /config/custom-covers waiting for manual poll.
2026-05-05 14:36:33 | DEBUG    | Read tags from Comics /comics: 0/0
2026-05-05 14:36:33 | DEBUG    | Library /comics update in progress. Not polling.
2026-05-05 14:36:33 | INFO     | Library /config/custom-covers waiting for manual poll.

Test plan

  • make fix and make lint (the unrelated remark error on . is preexisting on develop)
  • pytest tests/ — 35 passed
  • Sanity-check a running instance: confirm the custom-covers waiting for manual poll INFO line appears once per polling cycle, not twice
  • Confirm scheduled polling still fires at the configured interval (no infinite waits when only library was the one just polled — the new code folds the post-poll poll_every into the running min so the wait isn't None)

🤖 Generated with Claude Code

The poller's main loop computed timeouts in two passes: ``_get_min_timeout``
to find the soonest due library, then ``_poll_due_libraries`` to actually
poll them. Both called ``_get_poll_timeout`` per library, and that helper
emits the INFO line "Library X waiting for manual poll." as a side effect
for every ``poll=False`` library it sees. Result: the line appeared twice
in the log every cycle a library was due — most visibly for the
``custom-covers`` library, which is always poll=False.

Fold the two passes into one method that polls each due library inline
and folds its post-poll ``poll_every`` into the running min, so each
library is inspected exactly once per cycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ajslater
ajslater merged commit 5129326 into develop May 7, 2026
3 checks passed
@ajslater
ajslater deleted the claude/compassionate-chaum-872bad branch May 11, 2026 00:10
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