Commit ad74df56 authored by Шаронов Егор Алексеевич's avatar Шаронов Егор Алексеевич
Browse files

update OTLPConfig default to insecure=true and improve parsedProducts handling

parent efcdec34
No related merge requests found
Pipeline #172748 passed with stages
in 1 minute and 5 seconds
Showing with 10 additions and 3 deletions
+10 -3
......@@ -77,7 +77,7 @@ type OTelConfig struct {
// OTLPConfig задаёт параметры приёма трейсов.
type OTLPConfig struct {
Insecure bool `env:"INSECURE,default=false"`
Insecure bool `env:"INSECURE,default=true"`
Endpoint string `env:"ENDPOINT,default=localhost:4317" validate:"required,url"`
Timeout time.Duration `env:"TIMEOUT,default=10s"`
HTTP bool `env:"HTTP,default=false"`
......
......@@ -334,8 +334,15 @@ func (s *Server) PostLlmRequest(ctx context.Context, req PostLlmRequestRequestOb
cnt = make(map[string]interface{})
}
parsedProducts, _ := s.ProductService.GetParsedProductsByAbstractID(ctx, p.ID)
minPrice := parsedProducts[0].Price
firstPhoto := parsedProducts[0].PhotoUrls[0]
var minPrice = 0.0
var firstPhoto = ""
if (len(parsedProducts)) > 0 {
minPrice = parsedProducts[0].Price
if len(parsedProducts[0].PhotoUrls) > 0 {
firstPhoto = parsedProducts[0].PhotoUrls[0]
}
}
for _, pp := range parsedProducts {
minPrice = min(minPrice, pp.Price)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment