podkrepi-bg / api

Nest.js REST backend for charity platform Podkrepi.bg https://podkrepi.bg/swagger
https://podkrepi.bg
MIT License
82 stars 43 forks source link

fix(prisma): Too many idle db connections #646

Closed sashko9807 closed 2 months ago

sashko9807 commented 2 months ago

When importing a service through the provider interface of the module, NestJS creates new instance each time that provider service is referenced.

For example if we have 20 modules which have PrismaService as a provider, a 20 instances of PrismaService will be created, which could result in many idle db connections.

To fix this:

github-actions[bot] commented 2 months ago

✅ Tests will run for this PR. Once they succeed it can be merged.