|
|
@@ -1148,6 +1148,18 @@ async def _background_refresh_loop():
|
|
|
)
|
|
|
logger.info("startup prune_result=%s", prune_result)
|
|
|
|
|
|
+ # Seed feed_state from .env — insert missing feeds, leave existing alone
|
|
|
+ feed_urls = [u.strip() for u in NEWS_FEED_URLS.split(",") if u.strip()]
|
|
|
+ if not feed_urls and NEWS_FEED_URL:
|
|
|
+ feed_urls = [NEWS_FEED_URL]
|
|
|
+ with _shared_store._conn() as conn:
|
|
|
+ for url in feed_urls:
|
|
|
+ conn.execute(
|
|
|
+ "INSERT OR IGNORE INTO feed_state(feed_key, last_hash, last_item_count, enabled, updated_at) VALUES(?, '', 0, 1, '')",
|
|
|
+ (url,),
|
|
|
+ )
|
|
|
+ logger.info("startup seeded %d feeds into feed_state", len(feed_urls))
|
|
|
+
|
|
|
if not NEWS_BACKGROUND_REFRESH_ENABLED:
|
|
|
return
|
|
|
|