flypiggyyoyoyo commented on code in PR #868:
URL: 
https://github.com/apache/incubator-seata-go/pull/868#discussion_r2264700610


##########
pkg/saga/statemachine/engine/config/default_statemachine_config.go:
##########
@@ -492,9 +492,20 @@ func (c *DefaultStateMachineConfig) initServiceInvokers() 
error {
                c.serviceInvokerManager = invoker.NewServiceInvokerManagerImpl()
        }
 
-       defaultServiceType := "local"
-       if existingInvoker := 
c.serviceInvokerManager.ServiceInvoker(defaultServiceType); existingInvoker == 
nil {
-               c.RegisterServiceInvoker(defaultServiceType, 
invoker.NewLocalServiceInvoker())
+       if existing := c.serviceInvokerManager.ServiceInvoker("local"); 
existing == nil {

Review Comment:
   I guess you're referring to the GetServiceInvoker method, whose current 
implementation directly returns 
c.serviceInvokerManager.ServiceInvoker(serviceType). I think your point is very 
reasonable. We can add both a default field and logic for returning errors for 
invalid cases. I will modify it and submit the changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to