forked from genewildish/Mainline
feat: Add fast startup fetch and background caching
- Add for quick startup using first N feeds - Add background thread for full fetch and caching - Update to use fast fetch - Update docs and skills
This commit is contained in:
@@ -8,7 +8,7 @@ import time
|
||||
from engine import config
|
||||
from engine.display import BorderMode, DisplayRegistry
|
||||
from engine.effects import get_registry
|
||||
from engine.fetch import fetch_all, fetch_poetry, load_cache
|
||||
from engine.fetch import fetch_all, fetch_all_fast, fetch_poetry, load_cache, save_cache
|
||||
from engine.pipeline import (
|
||||
Pipeline,
|
||||
PipelineConfig,
|
||||
@@ -208,7 +208,18 @@ def run_pipeline_mode_direct():
|
||||
if cached:
|
||||
source_items = cached
|
||||
else:
|
||||
source_items, _, _ = fetch_all()
|
||||
source_items = fetch_all_fast()
|
||||
if source_items:
|
||||
import threading
|
||||
|
||||
def background_fetch():
|
||||
full_items, _, _ = fetch_all()
|
||||
save_cache(full_items)
|
||||
|
||||
background_thread = threading.Thread(
|
||||
target=background_fetch, daemon=True
|
||||
)
|
||||
background_thread.start()
|
||||
elif source_name == "fixture":
|
||||
source_items = load_cache()
|
||||
if not source_items:
|
||||
|
||||
Reference in New Issue
Block a user