soulsync/api
JohnBaumb 06220a5a83 fix: add periodic cleanup timer for api/request in-memory store
Inbound music requests are tracked in an in-memory _pending_requests

dict with a 1-hour TTL. Cleanup was only triggered inside

create_request(), so during quiet periods stale entries stayed in

memory until the next inbound request.

Add a background thread that wakes every 5 minutes and evicts any

entry older than _MAX_REQUEST_AGE. The thread is started once during

API blueprint registration (start_cleanup_thread is idempotent) and

is a daemon, so it exits automatically on process shutdown.

stop_cleanup_thread() is exposed for tests and future graceful-

shutdown hooks. It signals the stop event so the thread exits

without waiting for the next cleanup interval.
2026-04-19 15:22:25 -07:00
..
__init__.py fix: add periodic cleanup timer for api/request in-memory store 2026-04-19 15:22:25 -07:00
auth.py fix: throttle auth last_used_at config writes 2026-04-19 15:22:24 -07:00
cache.py enrich SoulSync API and update the DOCS 2026-03-04 13:42:47 -08:00
discover.py enrich SoulSync API and update the DOCS 2026-03-04 13:42:47 -08:00
downloads.py fix: add pagination and status filter to downloads endpoint 2026-04-19 15:22:25 -07:00
helpers.py Enrich the SoulSync API 2026-03-04 13:19:39 -08:00
library.py fix: eliminate double-query in track search 2026-04-19 15:22:24 -07:00
listenbrainz.py Full automation engine expansion with scheduling, triggers, actions, and UI polish 2026-03-05 15:13:32 -08:00
playlists.py Add SoulSync REST API (v1) with API key authentication 2026-03-03 09:49:00 -08:00
profiles.py enrich SoulSync API and update the DOCS 2026-03-04 13:42:47 -08:00
request.py fix: add periodic cleanup timer for api/request in-memory store 2026-04-19 15:22:25 -07:00
retag.py enrich SoulSync API and update the DOCS 2026-03-04 13:42:47 -08:00
search.py Fix remaining Spotify-first source selection in seasonal discovery and search API 2026-04-10 12:47:16 -07:00
serializers.py Add interactive REST API docs with full endpoint tester and complete metadata serialization 2026-03-13 17:45:01 -07:00
settings.py Encrypt sensitive config values at rest with Fernet — transparent migration, zero breaking changes 2026-03-12 09:25:25 -07:00
system.py Add SoulSync REST API (v1) with API key authentication 2026-03-03 09:49:00 -08:00
watchlist.py Enrich the SoulSync API 2026-03-04 13:19:39 -08:00
wishlist.py fix: push wishlist pagination to SQL 2026-04-19 15:22:24 -07:00