-
-
Notifications
You must be signed in to change notification settings - Fork 880
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
Remove update and read site config. Fixes #2306 #2329
Conversation
crates/utils/src/settings/mod.rs
Outdated
pub fn get() -> Self { | ||
SETTINGS.read().expect("read config").to_owned() | ||
pub fn get() -> &'static Self { | ||
&SETTINGS | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably remove this get() method, and make SETTINGS public instead. Also, i dont think Settings::init() needs to be public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see how big a refactor this would be.
4c0bdf0
to
3e35b4b
Compare
@@ -29,7 +29,7 @@ impl Settings { | |||
/// Note: The env var `LEMMY_DATABASE_URL` is parsed in | |||
/// `lemmy_db_schema/src/lib.rs::get_database_url_from_env()` | |||
/// Warning: Only call this once. | |||
pub fn init() -> Result<Self, LemmyError> { | |||
pub(crate) fn init() -> Result<Self, LemmyError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this crate only.
/// Returns the config as a struct. | ||
pub fn get() -> Self { | ||
SETTINGS.read().expect("read config").to_owned() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this public get.
3e35b4b
to
dc9f443
Compare
No description provided.