Skip to content

Commit

Permalink
Merge pull request #51 from Antiwall/master
Browse files Browse the repository at this point in the history
chore:: Upgrade lru to 0.12.3
  • Loading branch information
BinChengZhao authored May 20, 2024
2 parents 194f470 + 2565c1a commit 8f9a156
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cron_clock = "0.8.0"
anyhow = "^1.0.31"
rs-snowflake = "0.6.0"
dashmap = "^4.0.2"
lru = "^0.7.5"
lru = "^0.12.3"
once_cell = "1.9.0"
futures = "^0.3.13"
smol = "^1.2.5"
Expand Down
3 changes: 2 additions & 1 deletion src/timer/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use super::runtime_trace::task_handle::DelayTaskHandler;
use crate::prelude::*;

use std::num::NonZeroUsize;
use std::cell::RefCell;
use std::fmt;
use std::fmt::Pointer;
Expand All @@ -13,7 +14,7 @@ use cron_clock::{Schedule, ScheduleIteratorOwned, Utc};
use lru::LruCache;

// Parsing cache for cron expressions, stored with thread-local storage.
thread_local!(static CRON_EXPRESSION_CACHE: RefCell<LruCache<ScheduleIteratorTimeZoneQuery, DelayTimerScheduleIteratorOwned>> = RefCell::new(LruCache::new(256)));
thread_local!(static CRON_EXPRESSION_CACHE: RefCell<LruCache<ScheduleIteratorTimeZoneQuery, DelayTimerScheduleIteratorOwned>> = RefCell::new(LruCache::new(NonZeroUsize::new(256).unwrap())));

// TaskMark is used to maintain the status of running tasks.
#[derive(Default, Debug)]
Expand Down

0 comments on commit 8f9a156

Please sign in to comment.