@@ -421,6 +421,8 @@ impl Ctx {
421
421
generation,
422
422
config,
423
423
} => {
424
+ let metadata = config. metadata . deserialize ( ) ?;
425
+
424
426
let mut actors = self . actors . write ( ) . await ;
425
427
426
428
if actors. contains_key ( & ( actor_id, generation) ) {
@@ -430,7 +432,7 @@ impl Ctx {
430
432
"actor with this actor id + generation already exists, ignoring start command" ,
431
433
) ;
432
434
} else {
433
- let actor = Actor :: new ( actor_id, generation, * config) ;
435
+ let actor = Actor :: new ( actor_id, generation, * config, metadata ) ;
434
436
435
437
// Insert actor
436
438
actors. insert ( ( actor_id, generation) , actor) ;
@@ -718,6 +720,7 @@ impl Ctx {
718
720
719
721
let config = serde_json:: from_slice :: < protocol:: ActorConfig > ( & row. config ) ?;
720
722
let generation = row. generation . try_into ( ) ?;
723
+ let metadata = config. metadata . deserialize ( ) ?;
721
724
722
725
match & isolate_runner {
723
726
Some ( isolate_runner) if pid == isolate_runner. pid ( ) . as_raw ( ) => { }
@@ -736,7 +739,7 @@ impl Ctx {
736
739
}
737
740
738
741
// Clean up actor. We run `cleanup_setup` instead of `cleanup` because `cleanup` publishes events.
739
- let actor = Actor :: new ( row. actor_id , generation, config) ;
742
+ let actor = Actor :: new ( row. actor_id , generation, config, metadata ) ;
740
743
actor. cleanup_setup ( self ) . await ;
741
744
}
742
745
@@ -878,6 +881,7 @@ impl Ctx {
878
881
879
882
let config = serde_json:: from_slice :: < protocol:: ActorConfig > ( & row. config ) ?;
880
883
let generation = row. generation . try_into ( ) ?;
884
+ let metadata = config. metadata . deserialize ( ) ?;
881
885
882
886
let runner = match & isolate_runner {
883
887
// We have to clone the existing isolate runner handle instead of creating a new one so it
@@ -901,7 +905,7 @@ impl Ctx {
901
905
} ,
902
906
} ;
903
907
904
- let actor = Actor :: with_runner ( row. actor_id , generation, config, runner) ;
908
+ let actor = Actor :: with_runner ( row. actor_id , generation, config, metadata , runner) ;
905
909
let actor = actors_guard
906
910
. entry ( ( row. actor_id , generation) )
907
911
. or_insert ( actor) ;
0 commit comments