-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item be evicted before reaching the TTL #358
Comments
To be more specific: let c = Cache::builder()
.time_to_live(Duration::from_secs(60 * 60 * 24)) // live, 24h
.build(),
let app = MyStruct{c};
HttpServer::new(move || {
App::new()
.app_data(web::Data::new(app.clone()))
//....
}).bind(("0.0.0.0", 8888))?
.run()
.await; But after I changed to: let c = Cache::builder()
.time_to_live(Duration::from_secs(60 * 60 * 24)) // live, 24h
.build(),
HttpServer::new(move || {
App::new()
.app_data(web::Data::new(MyStruct{c})) // Now inside
//....
}).bind(("0.0.0.0", 8888))?
.run()
.await; And the problem occurs. |
Is this a problem with the smart pointers, and maybe the underlying issue is something inside the |
cubicYYY
added a commit
to cubicYYY/RIoT
that referenced
this issue
Dec 17, 2023
…ix-web worker threads moka-rs/moka#358
The reason: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I set my cache like this, make it unbounded.
This cache may be shared between threads.
However, I noticed that the items inserted will disappear very soon.
Is there an ensurance that items will always live longer than this TTL? How to let it expires after the TTL?
The text was updated successfully, but these errors were encountered: