Skip to content

Commit

Permalink
fix authentication config and block fields populate
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Oct 8, 2022
1 parent 14202e2 commit 99103ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const populateBlockFields = async () => {
const blockFieldsRepo = AppDataSource.getRepository(BlockFields)
const removeEntries = await blockFieldsRepo.find()
let entriesToAdd: BlockFields[] = []
const blockFieldsDoc = metloConfig["blockFields"]
const blockFieldsDoc = metloConfig?.["blockFields"]
if (blockFieldsDoc) {
for (const host in blockFieldsDoc) {
const hostEntries: BlockFields[] = []
Expand Down Expand Up @@ -110,12 +110,12 @@ const populateAuthentication = async () => {
}
const queryRunner = AppDataSource.createQueryRunner()
await queryRunner.connect()
await queryRunner.startTransaction()
try {
await queryRunner.startTransaction()
const metloConfig: object = yaml.load(
fs.readFileSync("./metlo-config.yaml", "utf-8"),
) as object
const authConfigDoc = metloConfig["authentication"]
const authConfigDoc = metloConfig?.["authentication"]
const authConfigEntries: AuthenticationConfig[] = []
if (authConfigDoc) {
authConfigDoc.forEach(item => {
Expand Down

0 comments on commit 99103ce

Please sign in to comment.