fix(customer): sync conversation name callback

This commit is contained in:
mlogclub
2026-05-02 11:36:32 +08:00
parent 853522404b
commit 84a0dba286
+8 -10
View File
@@ -136,17 +136,15 @@ func (s *customerService) EnsureExternalCustomer(ctx *sqls.TxContext, externalUs
}
ctx.RegisterCallback(func() {
go func() {
if strs.IsNotBlank(externalUser.ExternalName) {
if err := s.syncConversationCustomerName(sqls.DB(), identity.CustomerID, externalUser.ExternalName, nil, now); err != nil {
slog.Error("sync conversation customer name failed",
"customerId", identity.CustomerID,
"customerName", externalUser.ExternalName,
"error", err,
)
}
if strs.IsNotBlank(externalUser.ExternalName) {
if err := s.syncConversationCustomerName(sqls.DB(), identity.CustomerID, externalUser.ExternalName, nil, now); err != nil {
slog.Error("sync conversation customer name failed",
"customerId", identity.CustomerID,
"customerName", externalUser.ExternalName,
"error", err,
)
}
}()
}
})
return identity.CustomerID, nil
}