Skip to content

Phase 0: restart-free PoToken refresh via POST /youtube - #14

Merged
cycle-five merged 1 commit into
masterfrom
phase0/pot-live-refresh
Nov 6, 2026
Merged

cycle-five merged 1 commit into
masterfrom
phase0/pot-live-refresh

Conversation

@cycle-five-muse-personal

Copy link
Copy Markdown
Contributor

Phase 0 of docs/DESIGN-two-node-split.md — useful on the current single node, independent of the split.

Change

pot.refresh_and_inject() no longer restarts Lavalink on every 6-hourly rotation:

  1. Fetch a fresh token from bgutil (/get_pot), as before.
  2. New: push it live via the youtube plugin's POST /youtube route (YoutubeRestHandler in 1.18.x), with refreshToken: "x" — the route's sentinel for leaving OAuth untouched. Active players survive.
  3. Still write application.yml afterwards, but as cold-start seed only, so a restart boots with the freshest token before the first scheduled refresh.

Ordering matters: the live push happens before the seed write. If the push is rejected, the error propagates (and is recorded in state) with disk and runtime left consistent — the previously live token keeps serving.

The docker_ctl.restart_container import leaves pot.py entirely; the tokens router just updates its log wording.

Tests

163 passed (was 161; the pot suites now assert the live POST, its payload/auth header, the no-restart behaviour, and the push-before-seed ordering). pyflakes clean. Full suite re-run on this branch 2026-11-06 before push.

refresh_and_inject now pushes the fresh token to the running Lavalink
through the youtube plugin live update route (refreshToken "x" sentinel
leaves OAuth untouched) instead of rewriting application.yml and
restarting the container, which dropped every active player on each
6-hourly rotation. The yaml write remains, as the cold-start seed only.
Push ordering: live push before seed write, so a rejected push leaves
disk and runtime consistent. Tests: 163 passed (was 161), pyflakes clean.
@cycle-five
cycle-five merged commit ecc10b9 into master Nov 6, 2026
3 checks passed
@cycle-five
cycle-five deleted the phase0/pot-live-refresh branch November 6, 2026 14:57
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