Commit graph

11 commits

Author SHA1 Message Date
Jesse Bate
687c82cb32 feat: add YTP_MAX_HISTORY to cap history and prevent unbounded DB growth
Long-running instances accumulate history indefinitely. As the history
table grows, SQLite COUNT(*), paginated SELECT, and index scans degrade.

YTP_MAX_HISTORY (default: 0 = unlimited) caps the number of completed
download records kept. Enforcement is a hook in DataStore.put(): on
each insertion, the oldest excess entries are immediately evicted from
the in-memory OrderedDict and their deletes are enqueued to SQLite.
DataStore.load() also trims on startup in case the limit was lowered
between restarts. No background tasks, no DB reads needed for the check.
2026-06-10 20:29:18 +09:30
arabcoders
7ac7039592 chore: tests clean up 2026-05-04 22:23:19 +03:00
arabcoders
fc6bc88e61 refactor: use one tmp directory for tests 2026-04-27 00:31:14 +03:00
arabcoders
30a0c30d94 refactor: fix slowness in deleting big number of items
Co-authored-by: Copilot <copilot@github.com>
2026-04-24 23:18:14 +03:00
arabcoders
a85ca93d5a refactor: use sqlalchemy as base for sqlite 2026-01-17 23:32:39 +03:00
arabcoders
b912186502 chore: update tests assertion messages 2026-01-09 18:57:51 +03:00
arabcoders
b36d9fd641 Refactor: migrated whatleft of sync code to async 2025-12-18 18:21:34 +03:00
arabcoders
50f50bed9f Refactor: do not load history items in DownloadQueue 2025-12-18 17:08:18 +03:00
arabcoders
7a85bcdb5c Refactor: swap sqlite to aiosqlite and add queued db updates 2025-12-18 16:31:15 +03:00
arabcoders
6d9c7d70d9 Feat: update datastore.get_items to support operations 2025-11-14 17:49:01 +03:00
arabcoders
c91f199939 extends tests 2025-09-13 18:35:41 +03:00