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. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| core.py | ||
| hooks.py | ||
| item_adder.py | ||
| monitors.py | ||
| playlist_processor.py | ||
| pool_manager.py | ||
| process_manager.py | ||
| queue_manager.py | ||
| status_tracker.py | ||
| temp_manager.py | ||
| types.py | ||
| utils.py | ||
| video_processor.py | ||