Skip to content

fix: add lifecycle cleanup hooks and error handling for async operations#141

Merged
lukepolo merged 2 commits intomainfrom
audit/375-lifecycle-cleanup
Apr 17, 2026
Merged

fix: add lifecycle cleanup hooks and error handling for async operations#141
lukepolo merged 2 commits intomainfrom
audit/375-lifecycle-cleanup

Conversation

@Flegma
Copy link
Copy Markdown
Contributor

@Flegma Flegma commented Apr 8, 2026

Summary

  • Add OnApplicationShutdown to RedisManagerService to clear health check intervals and disconnect Redis on shutdown
  • Cap recursive setTimeout retries in MatchAssistantService.assignServer to 10 attempts
  • Replace void fire-and-forget patterns with .catch() error handlers in AppModule, SocketsService, and MatchesModule

Closes 5stackgg/5stack-panel#375, 5stackgg/5stack-panel#376

Test plan

  • Verify Redis health check intervals are cleared on app shutdown
  • Verify assignServer stops retrying after 10 attempts
  • Verify async errors are logged instead of silently dropped

Add OnApplicationShutdown to RedisManagerService to clear health check
intervals and disconnect Redis on shutdown. Cap recursive setTimeout
retries in assignServer to 10. Replace void fire-and-forget patterns
with .catch() error handlers in AppModule, SocketsService, and
MatchesModule.
Comment thread src/matches/matches.module.ts Outdated
@lukepolo lukepolo merged commit b0967d6 into main Apr 17, 2026
1 check passed
@lukepolo lukepolo deleted the audit/375-lifecycle-cleanup branch April 17, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] Missing NestJS lifecycle cleanup — intervals, recursive timeouts, stale WS refs

2 participants