chore(scheduler): dedup token-user query + drop pointless rss lambda

- Extract runner.token_users(db): the "all users with a stored refresh token"
  query was spelled 3× (get_service_user, run_subscription_resync,
  sync_all_playlists). get_service_user now reuses it ([0]); sync_all_playlists
  imports it from runner (no cycle — runner doesn't import playlists); the now-
  unused OAuthToken import is dropped there.
- scheduler.py: _job("rss_poll", lambda db: run_rss_poll(db)) → _job("rss_poll",
  run_rss_poll) — the lambda was dead indirection; all sibling jobs pass the
  callable directly and _job calls fn(db).

Behavior-neutral. ruff clean, localdev boots, re-review clean.
This commit is contained in:
npeter83 2026-07-11 19:44:53 +02:00
parent 4e68bdf920
commit a6ffcf9577
3 changed files with 14 additions and 23 deletions

View file

@ -209,7 +209,7 @@ def scheduler_snapshot() -> dict:
def _rss_job() -> None:
_job("rss_poll", lambda db: run_rss_poll(db))
_job("rss_poll", run_rss_poll)
def _enrich_job() -> None: