fix: only use cached potokens with min. 10min lifetime
This commit is contained in:
parent
a80f046a19
commit
0c94267d03
2 changed files with 49 additions and 17 deletions
|
|
@ -181,7 +181,7 @@ impl VisitorDataCache {
|
|||
pub fn get_pot(&self, visitor_data: &str) -> Option<PoToken> {
|
||||
let pots = self.inner.session_potoken.read().unwrap();
|
||||
if let Some(entry) = pots.get(visitor_data) {
|
||||
if entry.valid_until > OffsetDateTime::now_utc() {
|
||||
if entry.valid_until > OffsetDateTime::now_utc() + time::Duration::minutes(10) {
|
||||
return Some(entry.clone());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue