-
Notifications
You must be signed in to change notification settings - Fork 485
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
feat(core): expose configs always #5034
Conversation
Signed-off-by: tison <wander4096@gmail.com>
core/src/services/config.rs
Outdated
/// Sets the time to live of the cache. | ||
/// | ||
/// Refer to [`mini-moka::sync::CacheBuilder::time_to_live`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_live) | ||
pub time_to_live: Option<Duration>, |
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.
Duration
's default serde is weird (things like { "secs": 1, "nanos": 0 }
.
It's better to use humantime-serde
but that should be a follow up and breaking change.
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'm considering using an int
directly instead of exposing Duration
. What do you think?
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.
Somehow reasonable. In milliseconds precison?
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.
Overall, this idea looks good to me. However, placing it in services/mod.rs
might be difficult to maintain.
Do you think it would be better to have s3_config.rs
?
I move them to Each struct is tidy and no more extension can be added. So split to many files ( |
Signed-off-by: tison <wander4096@gmail.com>
01cc076
to
96ed78f
Compare
Signed-off-by: Xuanwo <github@xuanwo.io>
cc @tisonkun, please take a look. I prefer to have them in separate files for better readability and easier future code generation. |
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.
Thank you! You take the time and the result is fine :D
@Xuanwo let's give an approval and move forward. |
Resolve #5033
This demonstrates what will happen. @Xuanwo let's see if it's a good idea.