v0.2.0

Refresh Cycle

Last updated


This page explains the full order of one update check: trigger, new-article detection, background full-text extraction, and digest generation.

Triggers


SourceCallStatus bar
LaunchRun() → getList(false)Loading...
Ctrl+RgetList(true)Checking...
Auto check5-minute ticker → getList(true)Refreshing... → Checking...

The auto check starts as soon as New() creates the ticker and has no off switch; stopRefresh() stops the ticker when the program exits.

Check Steps


getList() runs these steps in a background goroutine:
StepAction
1If the list is empty, show articles from the last 72 hours via database.Get(72) first
2Collector.GetNews() fetches every active feed and returns articles within 72 hours
3Look up each article with GetFromURL(): not found counts as new; found reuses the stored publish time
4Sort newest first and update News List
5When there are new articles, run loadContent() in another goroutine

Step 3 reuses the stored time because an RSS item without a parseable pubDate falls back to the current time, which would drift on every check.
Step 4 replaces the list with what this fetch returned: an article that has dropped out of every feed leaves News List even though it stays in the database, and when no feed returns anything the list is emptied and the status bar shows All news are up to date.

Background Full-Text Extraction


loadContent() handles each article from this fetch:
ConditionAction
Full text already storedSkip
Extraction succeedsStore the article and full text, update progress, wait 500ms before the next one
Extraction failsStore the article with empty full text, log it, and move on immediately

Articles with empty full text are retried the next time a check finds at least one new article, because loadContent() walks every article from that fetch. When every article is processed, the LLM Digest runs.

Extraction on Preview


Moving through News List triggers showPreview() for a single article:
ConditionDisplay
Full text already storedShow the full text directly
No stored full text, live extraction succeedsShow the full text and store it in the background
Live extraction failsShow the RSS description
中文