missing updates #5
@@ -153,15 +153,14 @@ func (r *ProtoMutationRegistry) Apply(grain any, msg ...proto.Message) error {
|
||||
return fmt.Errorf("nil mutation message")
|
||||
}
|
||||
|
||||
for _, m := range msg {
|
||||
rt := indirectType(reflect.TypeOf(msg))
|
||||
r.mutationRegistryMu.RLock()
|
||||
entry, ok := r.mutationRegistry[rt]
|
||||
r.mutationRegistryMu.RUnlock()
|
||||
|
||||
if !ok {
|
||||
return ErrMutationNotRegistered
|
||||
}
|
||||
for _, m := range msg {
|
||||
if err := entry.Handle(grain, m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user