mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-09 21:48:12 -05:00
Clear read cache
This commit is contained in:
@@ -35,6 +35,10 @@ impl<SB: StorageBackend> Storage<SB> {
|
||||
.transaction_mut(Rc::downgrade(&self.sb), |sb| sb.remove_head(ptr))
|
||||
}
|
||||
|
||||
pub fn clear_read_cache(&mut self) {
|
||||
self.sb.borrow_mut().get_read_cache().clear()
|
||||
}
|
||||
|
||||
pub fn store_tmp<SE: StorageEntity<SB>>(
|
||||
&mut self,
|
||||
value: &SE,
|
||||
|
||||
@@ -107,7 +107,6 @@ impl DbActor {
|
||||
Self {
|
||||
storage,
|
||||
apply_fn: inline_valuescript(
|
||||
// TODO: store in actor
|
||||
r#"
|
||||
export default function(req) {
|
||||
if ("handleRequest" in this) {
|
||||
@@ -197,6 +196,9 @@ impl Handler<DbRequest> for DbActor {
|
||||
.set_head(storage_head_ptr(b"state"), &instance)
|
||||
.unwrap();
|
||||
|
||||
// TODO: Consider more cache retention
|
||||
self.storage.clear_read_cache();
|
||||
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user