Skip to content
Closed
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
10 changes: 10 additions & 0 deletions ab-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
* @borrows module:resApi as resApi
*/

// Map Environment Variables for redis. Needed to work with the ecs/app module.
// Keep this before any requires of cote
if (
Object.keys(process.env).every((k) => !k.startsWith("COTE_DISOCOVERY_REDIS"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So am I right in interpreting this as saying, "As long as there are no env variables that start with "COTE_DISCOVERY_REDIS", then make sure these COTE env variables are set?

What if only 1 or two are set? Do we need to account for that?

I was just looking at my setup, and I only have COTE_DISCOVERY_REDIS_HOST set. If any of our SESSION_REDIS_* values are set, shouldn't those ALWAYS map to the COTE_* values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do it that way. I don’t have a preference either way.
My thought was to do it this way so as not to interfere with existing deployments which will have set at least one COTE_DISCOVERY_REDIS param. But they wouldn’t have SESSION_REDIS_* set either.

Since we’re using a terraform module to set up the ecs app, will always get these 3 SESSION_REDIS params so I don’t think we need to account for that.

) {
process.env.COTE_DISCOVERY_REDIS_HOST = process.env.SESSION_REDIS_HOST;
process.env.COTE_DISCOVERY_REDIS_PORT = process.env.SESSION_REDIS_PORT;
process.env.COTE_DISCOVERY_REDIS_DB = process.env.SESSION_REDIS_DB_INDEX;
}

const config = require("./utils/config.js");
const controller = require("./utils/controller.js");
const defaults = require("./utils/defaults.js");
Expand Down
Loading
Loading