-
Notifications
You must be signed in to change notification settings - Fork 64
Improvement: Database Connection Caching #188
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestjwoc-2026For JWoC evaluationFor JWoC evaluationmediumGood for those who knows how things work, mostly includes enhancements of implemented features.Good for those who knows how things work, mostly includes enhancements of implemented features.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestjwoc-2026For JWoC evaluationFor JWoC evaluationmediumGood for those who knows how things work, mostly includes enhancements of implemented features.Good for those who knows how things work, mostly includes enhancements of implemented features.
The MongoDB connection in
lib/db/mongodb.jsis established on every call without caching in development mode.Impact:
In development with Hot Module Replacement (HMR), this can lead to "Too many connections" errors as connections aren't reused.
Fix:
Implement a caching mechanism (using global) to reuse the connection across hot reloads.