mirror of
https://github.com/hipcityreg/situation-monitor.git
synced 2026-04-27 08:36:01 +03:00
[PR #6] [MERGED] Add service layer with caching, circuit breakers, and Cloudflare Worker proxy #10
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/situation-monitor#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hipcityreg/situation-monitor/pull/6
Author: @xaelophone
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/10/2026
Merged by: @xaelophone
Base:
main← Head:feature/service-layer-optimization📝 Commits (10+)
a230a8fAdd custom error classes for service layer3dec087Add CacheManager with two-tier caching79d2bdeAdd CircuitBreaker for service failure management5708653Add RequestDeduplicator to prevent duplicate requests59e6fd3Add ServiceRegistry with per-service configurations1850ce8Add ServiceClient as unified fetch wrapperb9411bfAdd barrel export for service layerf12faeeMigrate data.js to use ServiceCliente369e21Add Cloudflare Worker CORS proxy (optional)cf62b35Fix broken RSS feeds and deploy Cloudflare Worker proxy📊 Changes
12 files changed (+1530 additions, -241 deletions)
View changed files
📝
js/constants.js(+5 -6)📝
js/data.js(+194 -197)📝
js/renderers.js(+30 -38)➕
js/services/CacheManager.js(+231 -0)➕
js/services/CircuitBreaker.js(+178 -0)➕
js/services/RequestDeduplicator.js(+71 -0)➕
js/services/ServiceClient.js(+281 -0)➕
js/services/ServiceRegistry.js(+121 -0)➕
js/services/errors.js(+34 -0)➕
js/services/index.js(+8 -0)➕
workers/proxy/index.js(+354 -0)➕
workers/proxy/wrangler.toml(+23 -0)📄 Description
Summary
Key Features
Service Layer (
js/services/)CacheManager- Two-tier caching with TTL and stale-while-revalidateCircuitBreaker- Prevents cascading failures with automatic recoveryRequestDeduplicator- Deduplicates concurrent identical requestsServiceRegistry- Per-service configuration (timeout, retries, cache TTL)ServiceClient- Unified fetch wrapper with exponential backoffCloudflare Worker (
workers/proxy/)?format=json)Bug Fixes
formatVolumeTypeError for pre-formatted stringsTest plan
getServiceHealth()in console to verify circuit breakers🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.