Kaynağa Gözat

Fix deprecations

DarthSim 1 yıl önce
ebeveyn
işleme
6bb5378352
2 değiştirilmiş dosya ile 4 ekleme ve 10 silme
  1. 2 8
      metrics/otel/otel.go
  2. 2 2
      transport/s3/s3.go

+ 2 - 8
metrics/otel/otel.go

@@ -37,7 +37,6 @@ import (
 	semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
 	"go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
 	"go.opentelemetry.io/otel/trace"
-	"google.golang.org/grpc"
 	"google.golang.org/grpc/credentials"
 
 	"github.com/imgproxy/imgproxy/v3/config"
@@ -236,13 +235,8 @@ func mapDeprecatedConfig() {
 }
 
 func buildGRPCExporters() (*otlptrace.Exporter, sdkmetric.Exporter, error) {
-	tracerOpts := []otlptracegrpc.Option{
-		otlptracegrpc.WithDialOption(grpc.WithBlock()),
-	}
-
-	meterOpts := []otlpmetricgrpc.Option{
-		otlpmetricgrpc.WithDialOption(grpc.WithBlock()),
-	}
+	tracerOpts := []otlptracegrpc.Option{}
+	meterOpts := []otlpmetricgrpc.Option{}
 
 	if tlsConf, err := buildTLSConfig(); tlsConf != nil && err == nil {
 		creds := credentials.NewTLS(tlsConf)

+ 2 - 2
transport/s3/s3.go

@@ -191,8 +191,8 @@ func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
 	if output.CacheControl != nil {
 		header.Set("Cache-Control", *output.CacheControl)
 	}
-	if output.Expires != nil {
-		header.Set("Expires", output.Expires.Format(http.TimeFormat))
+	if output.ExpiresString != nil {
+		header.Set("Expires", *output.ExpiresString)
 	}
 	if output.ETag != nil {
 		header.Set("ETag", *output.ETag)