Skip to content

Commit

Permalink
fix collector populate auth config
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Sep 26, 2022
1 parent a88e961 commit a6cf7a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const populateAuthentication = async () => {
}
const queryRunner = AppDataSource.createQueryRunner()
await queryRunner.connect()
await queryRunner.startTransaction()
try {
const metloConfig: object = yaml.load(
fs.readFileSync("./metlo-config.yaml", "utf-8"),
Expand Down Expand Up @@ -138,8 +139,10 @@ const populateAuthentication = async () => {
.values(authConfigEntries)
await deleteQb.execute()
await addQb.execute()
await queryRunner.commitTransaction()
} catch (err) {
console.error(`Error in populating metlo config authentication: ${err}`)
await queryRunner.rollbackTransaction()
} finally {
await queryRunner?.release()
}
Expand Down

0 comments on commit a6cf7a4

Please sign in to comment.