diff --git a/packages/backend-rs/src/cache/redis.rs b/packages/backend-rs/src/cache/redis.rs index 83cbd616d0..436ca1df2d 100644 --- a/packages/backend-rs/src/cache/redis.rs +++ b/packages/backend-rs/src/cache/redis.rs @@ -110,12 +110,13 @@ pub async fn set Deserialize<'a> + Serialize>( /// /// ``` /// # use backend_rs::cache; +/// use chrono::Duration; /// # async fn f() -> Result<(), Box> { /// let key = "banana"; /// let data = "I want to cache this string".to_owned(); /// /// // set cache -/// cache::set(key, &data, 10).await?; +/// cache::set(key, &data, Duration::seconds(10)).await?; /// /// // get cache /// let cached_data = cache::get::(key).await?; @@ -149,12 +150,13 @@ pub async fn get Deserialize<'a> + Serialize>(key: &str) -> Result Result<(), Box> { /// let key = "chocolate"; /// let value = "I want to cache this string".to_owned(); /// /// // set cache -/// cache::set(key, &value, 10).await?; +/// cache::set(key, &value, Duration::seconds(10)).await?; /// /// // delete the cache /// cache::delete("foo").await?;