Closed BaxHugh closed 7 months ago
Ok, I've had a dig, and we're using sled. sled has it's own rules about when it synchronises to disk I think, I don't know if it does it automatically on some timescale, but sled's Db::flush()
synchronises to disk.
One solution then would be to call connection.flush()
after setting a cache value.
From the discussion in https://github.com/jaemk/cached/issues/20, it looks like the expected behaviour of
io_cached
withdisk=true
is that the cache should persist between runs. I'm not sure if persistence functionality has been implemented yet, but is just bugged, or if it just hasn't been implemented yet, but I don't see persistence behaviour.Info:
Version 0.49.2 (latest) Also tested with current main
To reproduce
With the example code, run cargo run more than once. (additionaly adding a time argument to the io_cached macro gives the same behaviour)
Expected:
Actual:
Example code
Suggestions: