File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ impl VirtualConnectorCoordinator {
102102 let prefix = root_key ( & self . 0 . namespace ) ;
103103 let inner = self . 0 . clone ( ) ;
104104 pyo3_async_runtimes:: tokio:: future_into_py ( py, async move {
105- let kv_cache = KvCache :: new ( inner. etcd_client . clone ( ) , "v1" , prefix, HashMap :: new ( ) )
105+ let kv_cache = KvCache :: new ( inner. etcd_client . clone ( ) , prefix, HashMap :: new ( ) )
106106 . await
107107 . map_err ( to_pyerr) ?;
108108 * inner. kv_cache . lock ( ) = Some ( Arc :: new ( kv_cache) ) ;
@@ -497,5 +497,5 @@ fn load(a: &AtomicUsize) -> usize {
497497}
498498
499499fn root_key ( namespace : & str ) -> String {
500- format ! ( "{namespace}/planner/" )
500+ format ! ( "v1/ {namespace}/planner/" )
501501}
Original file line number Diff line number Diff line change @@ -515,14 +515,11 @@ impl KvCache {
515515 /// Create a new KV cache for the given prefix
516516 pub async fn new (
517517 client : Client ,
518- version : & str ,
519518 prefix : String ,
520519 initial_values : HashMap < String , Vec < u8 > > ,
521520 ) -> Result < Self > {
522521 let mut cache = HashMap :: new ( ) ;
523522
524- let prefix = format ! ( "{version}/{prefix}" ) ;
525-
526523 // First get all existing keys with this prefix
527524 let existing_kvs = client. kv_get_prefix ( & prefix) . await ?;
528525 for kv in existing_kvs {
@@ -712,15 +709,15 @@ mod tests {
712709
713710 // Create a unique test prefix to avoid conflicts with other tests
714711 let test_id = uuid:: Uuid :: new_v4 ( ) . to_string ( ) ;
715- let prefix = format ! ( "test_kv_cache_{}/" , test_id) ;
712+ let prefix = format ! ( "v1/ test_kv_cache_{}/" , test_id) ;
716713
717714 // Initial values
718715 let mut initial_values = HashMap :: new ( ) ;
719716 initial_values. insert ( "key1" . to_string ( ) , b"value1" . to_vec ( ) ) ;
720717 initial_values. insert ( "key2" . to_string ( ) , b"value2" . to_vec ( ) ) ;
721718
722719 // Create the KV cache
723- let kv_cache = KvCache :: new ( client. clone ( ) , "v1" , prefix. clone ( ) , initial_values) . await ?;
720+ let kv_cache = KvCache :: new ( client. clone ( ) , prefix. clone ( ) , initial_values) . await ?;
724721
725722 // Test get
726723 let value1 = kv_cache. get ( "key1" ) . await ;
You can’t perform that action at this time.
0 commit comments