aboutsummaryrefslogtreecommitdiff
path: root/src/cache/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache/mod.rs')
-rw-r--r--src/cache/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cache/mod.rs b/src/cache/mod.rs
index 780c364..f02d1c6 100644
--- a/src/cache/mod.rs
+++ b/src/cache/mod.rs
@@ -52,7 +52,8 @@ use std::collections::{
};
use std::{
default::Default,
- sync::Arc
+ sync::Arc,
+ time::Duration,
};
mod cache_update;
@@ -756,6 +757,15 @@ impl Cache {
e.update(self)
}
+ /// Gets the duration it will try for when acquiring a write lock.
+ ///
+ /// Refer to the documentation for [`cache_lock_time`] for more information.
+ ///
+ /// [`cache_lock_time`]: struct.Settings.html#method.cache_lock_time
+ pub fn get_try_write_duration(&self) -> Option<Duration> {
+ self.settings.cache_lock_time
+ }
+
pub(crate) fn update_user_entry(&mut self, user: &User) {
match self.users.entry(user.id) {
Entry::Vacant(e) => {