mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 07:42:23 +00:00
fix(insights): back a failing status note off, and let no path skip the wait
A status note whose generation stalled or failed opened a fixed five-minute negative window, and only the read path honoured it. The ingest invalidator counted only a stored note as fresh, so every data sync re-enqueued each note whose last generation had just failed, and the worker generated it again whatever the window said. With a model that never answers, every sync bought another round of calls per note. The window now grows with the generations in a row that ended without a note (failure_streak, migration 0480): five minutes, doubling per failure, up to two hours. A written or re-dated note resets it. A failure inside an open window neither moves nor counts it. runStatusCompletion waits the window out before any provider work, whichever path selected the note again (a sync, a warm pass, a queued job), and the ingest invalidator no longer enqueues a note inside its window. A derived-score assessment that fails now opens the same window. The person's own regenerate closes the record's windows first, and saving the AI provider settings closes them and forgets the provider's health rows, so a fixed setup does not sit out a pause the old one earned. The window code moves to status-negative-window.ts; the status parity golden records that the mood note screened earlier in the same minute is no longer generated again inside its window. Refs #1279
This commit is contained in:
1 parent
ba4774e48a
commit
17c1518b35
22 files changed
+640
-250
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$comment": "Production functions over 200 lines, keyed \"file :: name\", and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.",
|
||||
"count": 352,
|
||||
"total": 113900,
|
||||
"total": 113890,
|
||||
"entries": {
|
||||
"app/achievements/page.tsx :: AchievementsPage": 206,
|
||||
"app/api/admin/backups/upload/route.ts :: apiHandler(arg)": 314,
|
||||
@@ -299,7 +299,7 @@
|
||||
"lib/insights/comprehensive-generate.ts :: generateComprehensiveInsight": 876,
|
||||
"lib/insights/features.ts :: extractFeatures": 796,
|
||||
"lib/insights/mood-aggregates.ts :: fetchMoodAggregates": 246,
|
||||
"lib/insights/status-provider.ts :: runStatusCompletion": 236,
|
||||
"lib/insights/status-provider.ts :: runStatusCompletion": 226,
|
||||
"lib/integrations/connection-health-load.ts :: loadConnectionFacts": 227,
|
||||
"lib/integrations/status.ts :: recordSyncFailure": 292,
|
||||
"lib/jobs/apple-health-import-worker.ts :: handleAppleHealthImport": 300,
|
||||
|
||||
Reference in new issue
Block a user