Code-Fight commented on code in PR #897:
URL: 
https://github.com/apache/incubator-seata-go/pull/897#discussion_r2410438430


##########
pkg/saga/statemachine/engine/config/default_statemachine_config.go:
##########
@@ -641,13 +696,24 @@ func NewDefaultStateMachineConfig(opts ...Option) 
(*DefaultStateMachineConfig, e
 
        c.stateMachineRepository = repository.GetStateMachineRepositoryImpl()
        c.stateLogRepository = repository.NewStateLogRepositoryImpl()
+       
repository.GetStateMachineRepositoryImpl().SetDefaultTenantId(c.defaultTenantId)
 
        c.syncProcessCtrlEventPublisher = 
process_ctrl.NewProcessCtrlEventPublisher(c.syncEventBus)
        c.asyncProcessCtrlEventPublisher = 
process_ctrl.NewProcessCtrlEventPublisher(c.asyncEventBus)
 
        for _, opt := range opts {
                opt(c)
        }
+       
repository.GetStateMachineRepositoryImpl().SetDefaultTenantId(c.defaultTenantId)
+
+       if _, statErr := os.Stat("config.yaml"); statErr == nil {
+               if err := c.LoadConfig("config.yaml"); err == nil {
+                       
repository.GetStateMachineRepositoryImpl().SetDefaultTenantId(c.defaultTenantId)
+                       log.Printf("Successfully loaded config from 
config.yaml")
+               } else {
+                       log.Printf("Failed to load config file (using 
default/env values): %v", err)

Review Comment:
   ζš‚δΈιœ€θ¦



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to