by Robin at 20240730; add delay
This commit is contained in:
parent
ae595246be
commit
c6e1a41288
|
@ -3,5 +3,6 @@ package apollostruct
|
|||
type AutoResponseCfg struct {
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
Delay int64 `json:"delay"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
|
|
@ -2022,6 +2022,8 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
|
|||
return
|
||||
}
|
||||
if createTimes.CreateTimes == 0 {
|
||||
go func() {
|
||||
time.Sleep(time.Duration(cfg.Delay) * time.Second)
|
||||
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
|
||||
ContactCustomerService: &dbstruct.ContactCustomerService{
|
||||
SessionId: req.ContactCustomerService.SessionId,
|
||||
|
@ -2032,9 +2034,8 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
|
|||
})
|
||||
if err != nil {
|
||||
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
}()
|
||||
isAutoResponsed = consts.ContactCustomerService_AutoResponsed
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue