diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d3ac26..79d39d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,7 @@ workflows: branches: only: - develop + - pm-2539 # Production builds are exectuted only on tagged commits to the # master branch. diff --git a/src/common/members-lookup.service.ts b/src/common/members-lookup.service.ts index 66e2748..0432154 100644 --- a/src/common/members-lookup.service.ts +++ b/src/common/members-lookup.service.ts @@ -20,7 +20,14 @@ export class MembersLookupService { return; } // Create a dedicated Prisma client targeting the members DB - this.client = new PrismaClient({ datasources: { db: { url } } }); + this.client = new PrismaClient({ + transactionOptions: { + timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT + ? parseInt(process.env.BA_SERVICE_PRISMA_TIMEOUT, 10) + : 10000, + }, + datasources: { db: { url } } + }); this.initialized = true; } diff --git a/src/common/prisma.service.ts b/src/common/prisma.service.ts index 952711f..2e4f63a 100644 --- a/src/common/prisma.service.ts +++ b/src/common/prisma.service.ts @@ -3,6 +3,16 @@ import { PrismaClient } from "@prisma/client"; @Injectable() export class PrismaService extends PrismaClient implements OnModuleInit { + constructor() { + super({ + transactionOptions: { + timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT + ? parseInt(process.env.BA_SERVICE_PRISMA_TIMEOUT, 10) + : 10000, + }, + }); + } + async onModuleInit() { await this.$connect(); }