worldmonitor patterns: circuit breaker + refresh scheduler + progressive hydration - #14
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ive hydration - TypeScript CircuitBreaker (dashboard/lib/core/circuit-breaker.ts) with cooldown, SWR, LRU eviction, IndexedDB persistence (16 tests) - Python CircuitBreaker (backend/utils/circuit_breaker.py) Redis-backed for arq workers (9 tests) - RefreshScheduler (dashboard/lib/core/refresh-scheduler.ts) merged poll loop + scheduler with dedup, backoff, visibility awareness (13 tests) - Wire breakers into 4 arq jobs: review_poll, competitor_watch, menu_sync, appointment_followup - Wire RefreshScheduler into DashboardShell via React context - Wire breakers into dashboard api.get() per-path - Progressive hydration: lazy-load CompetitorTab via React.lazy + Suspense - All 59 dashboard + 246 backend tests pass, Next.js build green
crewcricle
force-pushed
the
vorflux/worldmonitor-patterns
branch
from
July 26, 2026 08:26
6e38075 to
d16d4eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract infrastructure patterns from worldmonitor into LocalMate: a framework-agnostic Circuit Breaker (TypeScript + Python/Redis), a Refresh Scheduler (merged poll loop + scheduler), wiring into all 4 arq jobs + dashboard API + dashboard pages, and progressive hydration via React.lazy.
Changes
dashboard/lib/core/circuit-breaker.ts. Cooldown after N consecutive failures, stale-while-revalidate with background refresh, LRU eviction (256 entries default), optional IndexedDB persistence. Framework-agnostic with SSR safety. Global registry viacreateCircuitBreaker().backend/utils/circuit_breaker.py. Redis-backed for stateless arq workers. Failure counts, cooldown timestamps, and cached responses all carry TTLs for auto-cleanup.execute()returns cached value during cooldown, fires background SWR refresh.dashboard/lib/core/refresh-scheduler.ts. Merges worldmonitor's Smart Poll Loop + Refresh Scheduler. Dedup (inFlight set), pause-when-hidden (visibility API), exponential backoff capped at 2x. SSR-safe.CircuitBreaker.execute().@retry_on_failurestays as inner layer. Each job accepts optionalredis—Nonefallback skips breaker protection.DashboardShellcreatesRefreshSchedulervia React context. Review queue polls every 60s, SEO rankings every 300s, billing usage every 120s.api.get()wraps each request in a per-path circuit breaker (30s cache TTL).React.lazy+<Suspense>.Testing
TypeScript — dashboard unit tests
circuit-breaker.test.ts(16 tests),refresh-scheduler.test.ts(13 tests)Python — backend unit tests
test_circuit_breaker.py(9 tests)Build
Session Details
(aside)to your comment to have me ignore it.