Skip to content

Commit

Permalink
fix: proxy changes for Amos to bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
benforshey committed Jan 24, 2024
1 parent 72bbd54 commit 5143eaf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ AUTH_HOST=urs.earthdata.nasa.gov
AUTH_CLIENT_ID=ask-someone-for-this
AUTH_CLIENT_SECRET=ask-someone-for-this

MAIL_HOST=mailhost.gsfc.nasa.gov

MAIL_HOST=ndc-relay.ndc.nasa.gov
# Uncomment if you are planning to use Cognito for login
# follow the steps for creating a client at: https://www.npmjs.com/package/passport-cognito-oauth2
#COGNITO_CLIENT_DOMAIN=theCognitoClientDomain
Expand Down
1 change: 1 addition & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
app:
container_name: meditor_app
build: packages/app
restart: on-failure:3
env_file:
- .env
ports:
Expand Down
10 changes: 9 additions & 1 deletion packages/app/lib/nats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@ function connectToNats() {
return {
stan,
// also returning a promise that resolves when NATS connects
stanConnectPromise: new Promise<Stan>(resolve => {
stanConnectPromise: new Promise<Stan>((resolve, reject) => {
// wait for the connection to complete
stan.on('connect', () => {
log.info('Connected to NATS')
resolve(stan)
})

stan.on('error', (error: any) => {
if (stan) {
log.info('Stan is being resolved...', JSON.stringify(stan))

resolve(stan)
} else {
process?.exit()
}

log.error(error) //? do anything beyond logging?
})
}),
Expand Down

0 comments on commit 5143eaf

Please sign in to comment.