Skip to content

Commit

Permalink
Remove 1 when getting db connection (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrrikkotua authored Sep 5, 2023
1 parent 1246707 commit 6d35970
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setImmediate(async () => {
const emitter = new IntegrationDataWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)
const repo = new IntegrationDataRepository(store, log)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setImmediate(async () => {
const emitter = new IntegrationDataWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)
const repo = new IntegrationDataRepository(store, log)

Expand Down
4 changes: 3 additions & 1 deletion services/apps/integration_run_worker/src/bin/continue-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ setImmediate(async () => {
const emitter = new IntegrationRunWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)

const repo = new IntegrationRunRepository(store, log)

const run = await repo.findIntegrationRunById(runId)

if (run) {
log.info({ run }, 'Found run!')

if (run.state != IntegrationRunState.PENDING) {
log.warn(`Integration run is not pending, setting to pending!`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setImmediate(async () => {
const emitter = new IntegrationRunWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)

const repo = new IntegrationRunRepository(store, log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ setImmediate(async () => {
const emitter = new IntegrationRunWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)

const repo = new IntegrationRunRepository(store, log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ setImmediate(async () => {
const emitter = new IntegrationRunWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)

const repo = new IntegrationRunRepository(store, log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setImmediate(async () => {
const emitter = new IntegrationStreamWorkerEmitter(sqsClient, log)
await emitter.init()

const dbConnection = await getDbConnection(DB_CONFIG(), 1)
const dbConnection = await getDbConnection(DB_CONFIG())
const store = new DbStore(log, dbConnection)
const repo = new IntegrationStreamRepository(store, log)

Expand Down

0 comments on commit 6d35970

Please sign in to comment.