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

Centralize server-level config in new 'ServerConfig' struct. #48

Conversation

InsertCreativityHere
Copy link
Member

Currently, we store server-level configuration (the workspace_root and the built_in_slice_paths) in 2 places:
Once (the main one) in Session, but we also store copies of this data in every instance of SliceConfig too.

This PR removes the copies from SliceConfig. Now they're only stored in a single location (Session).
It also introduces a new ServerConfig to hold these data-points, so it's easier to pass around (instead of 2 separate fields).

Any time we need access to the server configuration, instead of using the copy in SliceConfig, we just take a &ServerConfig that the caller passes in.


This change means that we no longer need to fetch the root paths when constructing a SliceConfig.
This actually ends up simplifying alot of code, and lets us introduce Default implementations for a few types too.

Copy link
Contributor

@ReeceHumphreys ReeceHumphreys left a comment

Choose a reason for hiding this comment

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

Looks good to me!

server/src/slice_config.rs Outdated Show resolved Hide resolved
@InsertCreativityHere InsertCreativityHere merged commit b3a00b7 into zeroc-ice:main Feb 13, 2024
7 checks passed
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.

3 participants