Skip to content

Commit

Permalink
HEAT-230 move redis server (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrlee authored May 2, 2024
1 parent ead7064 commit a95a5bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helm_deploy/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Per environment values which override defaults in hmpps-component-dependencies/values.yaml

redis:
secretName: elasticache-redis-dev
secretName: elasticache-redis

apis:
serviceCatalogue:
Expand Down
6 changes: 4 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import initialiseAppInsights from './utils/appInsights'
import initialiseAppInsights, { flush } from './utils/appInsights'
import applicationInfo from './utils/applicationInfo'

import config, { type Environment } from './config'
Expand Down Expand Up @@ -45,9 +45,11 @@ const run = async () => {
logger.info(`Finished publishing dependency info`)

await redisClient.quit()
await flush()
}

run().catch(e => {
run().catch(async e => {
logger.error(e)
await flush()
process.exit(1)
})
6 changes: 6 additions & 0 deletions src/utils/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ export default function initialiseAppInsights({ applicationName, buildNumber }:
}
return null
}

export async function flush(): Promise<void> {
if (process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
await defaultClient.flush()
}
}

0 comments on commit a95a5bd

Please sign in to comment.