File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,22 @@ struct Batcher(GenericBatcher<StaticCTPendingLogEntry>);
1212#[ durable_object]
1313impl DurableObject for Batcher {
1414 fn new ( state : State , env : Env ) -> Self {
15- let ( _, name) = get_durable_object_name ( state) . unwrap ( ) ;
16- let params = & CONFIG . logs [ & name] ;
17- let kv = load_cache_kv ( & env, & name) . unwrap ( ) ;
15+ let ( _, object_name) = get_durable_object_name ( state) . unwrap ( ) ;
16+ // Get the log name from the batcher name (see 'get_durable_object_stub'
17+ // for how the batcher name is derived).
18+ let name = object_name. rsplit_once ( '_' ) . unwrap ( ) . 0 ;
19+ let params = & CONFIG . logs [ name] ;
20+ let kv = load_cache_kv ( & env, name) . unwrap ( ) ;
1821 let sequencer = get_durable_object_stub (
1922 & env,
20- & name,
23+ name,
2124 None ,
2225 "SEQUENCER" ,
2326 params. location_hint . as_deref ( ) ,
2427 )
2528 . unwrap ( ) ;
2629 let config = BatcherConfig {
27- name,
30+ name : name . to_string ( ) ,
2831 max_batch_entries : params. max_batch_entries ,
2932 batch_timeout_millis : params. batch_timeout_millis ,
3033 } ;
You can’t perform that action at this time.
0 commit comments