Resilience: hbf-stats
Error handling and retry patterns for this service. Platform-wide patterns:
docs/architecture/resilience.md
HTTP Retry
- Library: hbf-core-api (inherited, 3 attempts, exponential backoff for network errors)
- Attempts: 3 (inherited from hbf-core-api only; custom http-client.service.ts has zero retry)
- Backoff: Exponential (inherited)
- On failure: hbf-core-api retries network errors; http-client.service.ts (axios via HttpService) does not retry at all
Queue Retry
Not applicable. No queue consumers in this service.
Timeouts
| Call | Timeout | Configured in |
|---|---|---|
| HttpModule (axios) | None (no explicit timeout) | http-client.service.ts |
| hbf-core-api calls | None (no explicit timeout) | hbf-core-api client |
Circuit Breakers
None implemented.
Fallback Strategy
| Failure scenario | Behaviour | User impact |
|---|---|---|
| getOrganizationTimezone fails | Defaults to 'UTC' | Stats computed against UTC instead of org timezone |
| updateTenantStats fails | Error logged, no throw (silent fail) | Stale tenant stats until next successful run |
| getTenants fails | Error logged, exception thrown | Caller receives error |
| getTenantSummaryAnalytics fails | Error logged, returns undefined | Missing analytics data presented to caller |
Known Gaps
- http-client.service.ts wraps axios via HttpService with no retry logic
- No timeout configured on any HTTP calls (HttpModule registered without timeout)
- Silent failure in updateTenantStats: errors are logged but swallowed, so upstream callers have no signal that stats are stale
- getTenantSummaryAnalytics returns undefined on failure, callers must handle this explicitly
- No /health endpoint for liveness or readiness probes