Dashboard: content + source-health; per-viewer local dates
* Date fix: introduce GOODNEWS_TZ (goodnews/localtime.py) so the brief's "today" rolls over in a pinned zone (Eastern) instead of UTC — robust to host-clock resets. The home page now formats the brief's date in each VISITOR's local timezone (from its UTC freshness stamp), so nobody ever sees "tomorrow." * Admin "Content served": articles live, fresh (7d), ingested (24h), summaries, active sources, today's brief size — queries.content_stats(). * Admin "Source health": per active source, the failure streak, last error, accepted contribution, and computed next-poll time (so backoff / "resting until" is visible), via queries.source_health() reusing the feeds backoff math. Failing sources sort to the top; times render in the viewer's zone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlite3
|
||||
from datetime import date
|
||||
|
||||
from .localtime import local_today
|
||||
from .paywall import is_paywalled
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ def build_daily_brief(
|
||||
replace: bool = False,
|
||||
window_days: int = 3,
|
||||
) -> int:
|
||||
target_date = brief_date or date.today().isoformat()
|
||||
target_date = brief_date or local_today()
|
||||
|
||||
# Compose the selection first so we can tell whether anything actually
|
||||
# changed. A calm daily brief shouldn't repeatedly hand the reader a locked
|
||||
|
||||
Reference in New Issue
Block a user