Skip to content

Conversation

shamsartem
Copy link
Contributor

No description provided.

Copy link

linear bot commented Oct 30, 2024

JS-831 refactor configs

@shamsartem shamsartem requested a review from MixailE October 30, 2024 08:29
} else {
try {
// ensure env config also when provider.yaml exists
await access(getProviderConfigPath());
setEnvConfig(await initNewEnvConfig());
} catch {
const envConfig = await initEnvConfig();
Copy link

Choose a reason for hiding this comment

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

We don't need that anymore?

Copy link
Contributor Author

@shamsartem shamsartem Nov 6, 2024

Choose a reason for hiding this comment

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

I added a global "cache" for all configs long ago (and for refactored configs I also added this "cache"), cause essentially when you init a config object you can reuse it for the duration of CLI running cause it is expected not to move anywhere, so there is no need anymore to store it globally separately, cause it's already stored globally anyway (there is a Map<configPath, config>).

… when using Promise.all that inits and manipulates the same config
Copy link

@MixailE MixailE left a comment

Choose a reason for hiding this comment

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

LGTM

@shamsartem shamsartem merged commit 89cbed0 into main Nov 8, 2024
9 checks passed
@shamsartem shamsartem deleted the refactor branch November 8, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants