Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
antonjim-te committed Sep 19, 2023
1 parent 15b3b42 commit 409f6ff
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions exporter/exporterhelper/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporte

import (
"context"
"time"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/exporter"
Expand Down Expand Up @@ -232,21 +230,3 @@ func (be *baseExporter) setOnTemporaryFailure(onTemporaryFailure onRequestHandli
rs.onTemporaryFailure = onTemporaryFailure
}
}

// timeoutSender is a requestSender that adds a `timeout` to every request that passes this sender.
type timeoutSender struct {
baseRequestSender
cfg TimeoutSettings
}

func (ts *timeoutSender) send(req internal.Request) error {
// Intentionally don't overwrite the context inside the request, because in case of retries deadline will not be
// updated because this deadline most likely is before the next one.
ctx := req.Context()
if ts.cfg.Timeout > 0 {
var cancelFunc func()
ctx, cancelFunc = context.WithTimeout(req.Context(), ts.cfg.Timeout)
defer cancelFunc()
}
return req.Export(ctx)
}

0 comments on commit 409f6ff

Please sign in to comment.