This commit is contained in:
2024-01-08 03:04:22 +01:00
parent 7b6b43ca81
commit 91fe59b215
2 changed files with 6 additions and 2 deletions

View File

@@ -57,7 +57,9 @@ pub static BOTS_ROUTES: Lazy<Cache<String, StopTokenWithSender>> = Lazy::new(||
Cache::builder()
.time_to_idle(Duration::from_secs(60 * 60))
.max_capacity(100)
.eviction_listener(|_token, value: StopTokenWithSender, _cause| {
.eviction_listener(|token, value: StopTokenWithSender, _cause| {
log::info!("Stop Bot(token={})!", token);
let (stop_token, mut sender) = value;
stop_token.stop();