feat(server): refactor handlers, router, state management, and memory tools
This commit is contained in:
1 parent
87ddb01063
commit
a083719cf1
36 files changed
+1899
-597
No files matched your search
+10
-11
@@ -112,19 +112,18 @@ mod tests {
|
||||
data.value = 42;
|
||||
});
|
||||
|
||||
// Need to wait for spawn_blocking to finish
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
|
||||
assert_eq!(
|
||||
store.read_with(|s| s.clone()),
|
||||
TestData {
|
||||
name: "Hello".to_string(),
|
||||
value: 42
|
||||
// Wait and poll for persistence completion
|
||||
let mut store2 = None;
|
||||
for _ in 0..20 {
|
||||
let s = Store::<TestData>::new("test_key", db.clone());
|
||||
if s.read_with(|data| data.value) == 42 {
|
||||
store2 = Some(s);
|
||||
break;
|
||||
}
|
||||
);
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(50)).await;
|
||||
}
|
||||
|
||||
// Load again to verify persistence
|
||||
let store2 = Store::<TestData>::new("test_key", db.clone());
|
||||
let store2 = store2.expect("Timed out waiting for async store persistence");
|
||||
assert_eq!(
|
||||
store2.read_with(|s| s.clone()),
|
||||
TestData {
|
||||
|
||||
Reference in new issue
Block a user