Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

gateway: Don't panic because of duplicate env var registration#63787

Merged
jhchabran merged 2 commits into
mainfrom
es/07-11-gatewaydontpanicbecauseofduplicateenvvarregistration
Jul 11, 2024
Merged

gateway: Don't panic because of duplicate env var registration#63787
jhchabran merged 2 commits into
mainfrom
es/07-11-gatewaydontpanicbecauseofduplicateenvvarregistration

Conversation

@eseliger

Copy link
Copy Markdown
Member

REDIS_ENDPOINT is now registered by gateway, but it is also registered in internal/redispool as the fallback for when the other values are not set.

The real fix would be to not have env vars in that package, and instead each service creates one instance of each of those two in their cmd/, but that's a lot of work so short-term fixing it by reading the fallback using os.Getenv.

Test plan:

sg run cody-gateway doesn't panic.

`REDIS_ENDPOINT` is now registered by gateway, but it is also registered in `internal/redispool` as the fallback for when the other values are not set.

The real fix would be to not have env vars in that package, and instead each service creates one instance of each of those two in their `cmd/`, but that's a lot of work so short-term fixing it by reading the fallback using os.Getenv.

Test plan:

`sg run cody-gateway` doesn't panic.
@cla-bot cla-bot Bot added the cla-signed label Jul 11, 2024
@eseliger eseliger marked this pull request as ready for review July 11, 2024 14:00

eseliger commented Jul 11, 2024

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @eseliger and the rest of your teammates on Graphite Graphite

@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels Jul 11, 2024
@jhchabran jhchabran self-requested a review July 11, 2024 14:09
@jhchabran jhchabran enabled auto-merge (squash) July 11, 2024 17:51
@jhchabran jhchabran merged commit 197ad80 into main Jul 11, 2024
@jhchabran jhchabran deleted the es/07-11-gatewaydontpanicbecauseofduplicateenvvarregistration branch July 11, 2024 17:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants