[CORRUPTED] Synthetic Benchmark PR #26622 - chore: USE_POOL env var for api v2 prisma pooling #712
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.
Benchmark PR calcom#26622
Type: Corrupted (contains bugs)
Original PR Title: chore: USE_POOL env var for api v2 prisma pooling
Original PR Description: ## What does this PR do?
Adds a
USE_POOLenv var to toggle Prisma connection pooling in API v2. When disabled (USE_POOL=false), Prisma connects directly viadatasourceUrlinstead of using the pg Pool. This provides flexibility for environments where connection pooling may not be desired.Key Changes
db.usePoolconfig sourced fromUSE_POOLenv var (default:true)PrismaReadServiceandPrismaWriteServicenow conditionally usePrismaPg+ pg Pool or directPrismaClientbased onusePoolUSE_POOLto env types and updated workers/main modules to read pool sizes with radix 10process.envusage withinapps/api/v2(specific files only)node:processimports in favor of globalprocess(required for NestJS compatibility)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
USE_POOL=true(or omit it) and verify API v2 uses connection poolingUSE_POOL=falseand verify API v2 connects directly without poolingChecklist for Human Review
PrismaReadServiceandPrismaWriteServicehandles both modes correctlynode:processimports doesn't cause runtime issues in NestJS contextUpdates since last revision
biome.jsonincludes array (apps/api/v2/src/config/app.tswas listed twice)Link to Devin run: https://app.devin.ai/sessions/f86d6319617546c8be13351466d34332
Original PR URL: calcom#26622