Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: proxy changes for Amos to bugfix #47

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,7 +24,7 @@ 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')
Expand All @@ -33,6 +33,14 @@ function connectToNats() {

stan.on('error', (error: any) => {
log.error(error) //? do anything beyond logging?

if (stan) {
log.debug('Stan is being resolved...', JSON.stringify(stan))

resolve(stan)
} else {
process?.exit()
}
})
}),
}
Expand Down
Loading