fix:算法请求调整

This commit is contained in:
momo 2023-10-10 15:10:15 +08:00
parent 2dc5a2435f
commit 984690c47a

View File

@ -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,