fix:请求算法,添加错误提示
This commit is contained in:
parent
e7de0c7842
commit
ed6326f07d
|
@ -99,13 +99,12 @@ type (
|
|||
ResourceId string
|
||||
ResourceUrl *string
|
||||
Metadata *string
|
||||
DiffTimeLogoCombine time.Duration
|
||||
DiffTimeUploadFile time.Duration
|
||||
DiffTimeLogoCombine int64
|
||||
DiffTimeUploadFile int64
|
||||
}
|
||||
)
|
||||
|
||||
func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) {
|
||||
logc.Infof(ctx, "合图--处理--开始时间:%v", time.Now().UTC())
|
||||
// 查询logo最新基础信息
|
||||
var metadata *string
|
||||
var logoUrl *string
|
||||
|
@ -198,7 +197,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
|||
postMap["param_data"] = combineParam
|
||||
|
||||
logc.Infof(ctx, "合图--算法请求--合图--开始时间:%v", time.Now().UTC())
|
||||
var startTimeLogoCombine = time.Now() //合图--处理--开始时间
|
||||
var startTimeLogoCombine = time.Now().UnixMilli() //合图--处理--开始时间
|
||||
|
||||
var resultBLM constants.BLMServiceUrlResult
|
||||
err = curl.NewClient(ctx, &curl.Config{
|
||||
|
@ -207,9 +206,9 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
|||
}).PostJson(postMap, &resultBLM)
|
||||
|
||||
logc.Infof(ctx, "合图--算法请求--合图--结束时间:%v", time.Now().UTC())
|
||||
endTimeLogoCombine := time.Now() //合图--处理--开始时间
|
||||
diffTimeLogoCombine := endTimeLogoCombine.Sub(startTimeLogoCombine) //合图--处理--中间差
|
||||
|
||||
endTimeLogoCombine := time.Now().UnixMilli() //合图--处理--开始时间
|
||||
diffTimeLogoCombine := endTimeLogoCombine - startTimeLogoCombine //合图--处理--中间差
|
||||
logc.Infof(ctx, "合图--算法请求--合图--业务耗时:%d", diffTimeLogoCombine)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return nil, err
|
||||
|
@ -239,7 +238,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
|||
}
|
||||
|
||||
logc.Infof(ctx, "合图--上传文件--开始时间:%v", time.Now().UTC())
|
||||
var startTimeUploadFile = time.Now() //合图--上传--开始时间
|
||||
var startTimeUploadFile = time.Now().UnixMilli() //合图--上传--开始时间
|
||||
|
||||
uploadRes, err := upload.UploadFileByBase64(&file.UploadBaseReq{
|
||||
Source: "combine-image",
|
||||
|
@ -251,14 +250,14 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
|||
GuestId: in.GuestId,
|
||||
})
|
||||
logc.Infof(ctx, "合图--上传文件--开始时间:%v", time.Now().UTC())
|
||||
endTimeUploadFile := time.Now() //合图--处理--开始时间
|
||||
diffTimeUploadFile := endTimeUploadFile.Sub(startTimeUploadFile) //合图--处理--中间差
|
||||
endTimeUploadFile := time.Now().UnixMilli() //合图--处理--开始时间
|
||||
diffTimeUploadFile := endTimeUploadFile - startTimeUploadFile //合图--处理--中间差
|
||||
|
||||
logc.Infof(ctx, "合图--上传文件--业务耗时:%d", diffTimeUploadFile)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return nil, err
|
||||
}
|
||||
logc.Infof(ctx, "合图--处理--结束时间:%v", time.Now().UTC())
|
||||
|
||||
return &LogoCombineRes{
|
||||
ResourceId: uploadRes.ResourceId,
|
||||
|
|
Loading…
Reference in New Issue
Block a user