如何获取 saga 执行结果?
作者: anotherGoogleFan创建于 2024年12月31日更新于 2025年10月11日
The code is as follows: saga := dtmcli.NewSaga(dtmServer, dtmcli.MustGenGid(dtmServer)). Add(logic1Path, logic1RollbackPath, nil). Add(logic2Path, logic2RollbackPath, nil) saga.WaitResult = true If err := saga.Submit(); err != nil { slog.Info("fail", slog.Any("err", err)) return }
内容来源: dtm-labs/dtm