fix: add Redis graceful degradation and health check (#126)#205
Merged
kilodesodiq-arch merged 1 commit intoJun 29, 2026
Merged
Conversation
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.
Summary
AdaptiveRateLimitGuardpreviously threw an unhandled exception when Redis was unavailable, taking down all endpoints. The health check also had no visibility into Redis status. This PR adds fail-open degradation to the rate limit guard and a Redis ping check to the readiness probe.Changes
adaptive-rate-limit.guard.ts: WrapgetOrThrow()and Redis operations in try/catch — logs a warning and allows requests through when Redis is downhealth.service.ts: AddcheckRedis()method usingRedisService.getOrThrow().ping(); includerediskey inReadinessResponse.checks; updateReadinessResponseinterfacehealth.module.ts: ImportRedisModuleto makeRedisServiceinjectable inHealthServicehealth.controller.spec.ts: AddRedisServicemock and update assertions to includeredisin readiness checksTesting
Build and lint pass. All 4 health controller tests pass. When Redis is unavailable, rate limiting is skipped rather than throwing 500 errors.
Closes #126