Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prisma): cleanup expiry timeout when process exits to prevent memory leak #289

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

0xturner
Copy link
Contributor

@0xturner 0xturner commented Jan 15, 2025

I noticed my app had hanging child processes when shutting down after introducing RateLimiterPrisma. Tracked it down to this timeout handler which is not being cleaned up

@squirly
Copy link

squirly commented Jan 15, 2025

An alternative would be to add a function that allows cleaning up this object/stopping the clearing. Possibly RateLimiterPrisma#close or RateLimiterPrisma#stopClearExpired. Updated implementation is a better approach.

@0xturner
Copy link
Contributor Author

Looks like this was already being handled in other adaptors, just missing from the Prisma one. Changed to be consistent with approach here

@animir animir merged commit d4faf5b into animir:master Jan 15, 2025
7 checks passed
@animir
Copy link
Owner

animir commented Jan 15, 2025

@0xturner Good catch. Thank you. It was released in v 5.0.5.

@0xturner 0xturner deleted the rate-limiter-prisma-memory-leak branch January 15, 2025 22:03
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.

3 participants