-
-
Notifications
You must be signed in to change notification settings - Fork 911
Closed
Labels
UrgentCreated by Linear-GitHub SyncCreated by Linear-GitHub SyncbugSomething isn't workingSomething isn't workinglinear
Milestone
Description
When we bulk upsert environment variables we wrap the entire thing in a database transaction. If there are a lot of env vars (e.g. more than 100) then the transaction can timeout.
You can see in the current code that the transaction is wrapped around the for loop:
trigger.dev/apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts
Line 138 in feb4fcd
| const result = await $transaction(this.prismaClient, async (tx) => { |
Instead we should move that transaction inside the for loop. We still need the transaction so we always create all the resources for each env var and don't leave any of them dangling.
agreea
Metadata
Metadata
Assignees
Labels
UrgentCreated by Linear-GitHub SyncCreated by Linear-GitHub SyncbugSomething isn't workingSomething isn't workinglinear