From 984690c47aa5033f853c5efa32ef8627a799e855 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 10 Oct 2023 15:10:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=AE=97=E6=B3=95=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/image_handle.go | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 7c05432c..a8ecf8d6 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -239,14 +239,6 @@ type TemplateTagColor struct { } func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) { - fmt.Println("算法请求轮训下标:", globalBLMServiceIndex) - var bLMServicePort = l.BLMServicePorts[globalBLMServiceIndex] - if len(l.BLMServicePorts) == (globalBLMServiceIndex + 1) { - globalBLMServiceIndex = 0 - } else { - globalBLMServiceIndex = globalBLMServiceIndex + 1 - } - logoResourceId := s3url_to_s3id.GetS3ResourceIdFormUrl(in.LogoUrl) if logoResourceId == "" { return nil, errors.New("invalid logo url") @@ -335,6 +327,14 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq postMap["tag_data"] = in.ProductTemplateTagGroups postMap["param_data"] = combineParam + fmt.Println("算法请求轮训下标:", globalBLMServiceIndex) + var bLMServicePort = l.BLMServicePorts[globalBLMServiceIndex] + if len(l.BLMServicePorts) == (globalBLMServiceIndex + 1) { + globalBLMServiceIndex = 0 + } else { + globalBLMServiceIndex = globalBLMServiceIndex + 1 + } + logc.Infof(ctx, "合图--算法请求--合图--开始时间:%v", time.Now().UTC()) var startTimeLogoCombine = time.Now().UnixMilli() //合图--处理--开始时间 @@ -430,14 +430,6 @@ type ( /* 图片裁剪 */ func (l *defaultImageHandle) LogoStandard(ctx context.Context, in *LogoStandardReq) (*LogoStandardRes, error) { - fmt.Println("算法请求轮训下标:", globalBLMServiceIndex) - var bLMServicePort = l.BLMServicePorts[globalBLMServiceIndex] - if len(l.BLMServicePorts) == (globalBLMServiceIndex + 1) { - globalBLMServiceIndex = 0 - } else { - globalBLMServiceIndex = globalBLMServiceIndex + 1 - } - var ismaxProportion bool var imgColor []string var logoStandardMetaData LogoStandardMetaData @@ -480,6 +472,14 @@ func (l *defaultImageHandle) LogoStandard(ctx context.Context, in *LogoStandardR postMap["height"] = in.Height postMap["proportion"] = in.Proportion + fmt.Println("算法请求轮训下标:", globalBLMServiceIndex) + var bLMServicePort = l.BLMServicePorts[globalBLMServiceIndex] + if len(l.BLMServicePorts) == (globalBLMServiceIndex + 1) { + globalBLMServiceIndex = 0 + } else { + globalBLMServiceIndex = globalBLMServiceIndex + 1 + } + logc.Infof(ctx, "算法请求--去背景--开始时间:%v", time.Now().UTC()) err = curl.NewClient(ctx, &curl.Config{ BaseUrl: *l.BLMServiceUrl + ":" + bLMServicePort,