File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11import { Logger , logExecutionTimeV2 } from '@crowd/logging'
22import { CrowdJob } from '../../types/jobTypes'
3- import { databaseInitNoCache } from '../../database/databaseConnection'
3+ import { databaseInit } from '../../database/databaseConnection'
44
55let processingRefreshCubeMVs = false
66
@@ -19,7 +19,8 @@ const job: CrowdJob = {
1919
2020 try {
2121 // initialize database with 15 minutes query timeout
22- const database = await databaseInitNoCache ( 1000 * 60 * 15 )
22+ const forceNewDbInstance = true
23+ const database = await databaseInit ( 1000 * 60 * 15 , forceNewDbInstance )
2324
2425 const materializedViews = [
2526 'mv_members_cube' ,
Original file line number Diff line number Diff line change @@ -5,14 +5,17 @@ let cached
55/**
66 * Initializes the connection to the Database
77 */
8- export async function databaseInit ( queryTimeoutMilliseconds : number = 30000 ) {
8+ export async function databaseInit (
9+ queryTimeoutMilliseconds : number = 30000 ,
10+ forceNewInstance : boolean = false ,
11+ ) {
12+ if ( forceNewInstance ) {
13+ return models ( queryTimeoutMilliseconds )
14+ }
15+
916 if ( ! cached ) {
1017 cached = models ( queryTimeoutMilliseconds )
1118 }
1219
1320 return cached
1421}
15-
16- export async function databaseInitNoCache ( queryTimeoutMilliseconds : number = 30000 ) {
17- return models ( queryTimeoutMilliseconds )
18- }
You can’t perform that action at this time.
0 commit comments