Skip to main content

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

CallTimeoutConfigured in
HttpModule (axios)None (no explicit timeout)http-client.service.ts
hbf-core-api callsNone (no explicit timeout)hbf-core-api client

Circuit Breakers

None implemented.

Fallback Strategy

Failure scenarioBehaviourUser impact
getOrganizationTimezone failsDefaults to 'UTC'Stats computed against UTC instead of org timezone
updateTenantStats failsError logged, no throw (silent fail)Stale tenant stats until next successful run
getTenants failsError logged, exception thrownCaller receives error
getTenantSummaryAnalytics failsError logged, returns undefinedMissing 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