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

Add cache-settings to client-builder. #1461

Merged
merged 1 commit into from Aug 5, 2021

Conversation

Splingush
Copy link
Contributor

Hello!

This adds a method to the client-builder for setting the cache-settings.
It only adds a method, but does not modify the existing cache_update_timeout.

Usage-example:

 Client::builder("token")
        .cache_settings(|cache| cache.max_messages(100))

Without these changes, the max_messages have to be set after the client has been created, via

client: Client = // [...]
client.cache_and_http.cache.set_max_messages(count).await

The settings were not modified, and currently only include the max_messages. But it might be future-proof for adding to it.

@arqunis arqunis added cache Related to the `cache`-feature. client Related to the `client` module. enhancement An improvement to Serenity. labels Aug 5, 2021
@arqunis arqunis merged commit ea8ec29 into serenity-rs:current Aug 5, 2021
@Splingush Splingush deleted the client_cache_options branch August 5, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache Related to the `cache`-feature. client Related to the `client` module. enhancement An improvement to Serenity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants