Skip to content

Commit

Permalink
Disabling Timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmattox committed Mar 4, 2024
1 parent 3af3bd5 commit 43dc211
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/proxy/RoundTrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package proxy

import (
"bytes"
"context"
"io"
"net/http"
"time"
Expand Down Expand Up @@ -30,12 +29,11 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
return t.RoundTripper.RoundTrip(req)
}

// Apply timeout through context
timeout := time.Duration(config.CFG.BackendTimeoutMs) * time.Millisecond
ctx, cancel := context.WithTimeout(req.Context(), timeout)
defer cancel() // Ensure the context is cancelled to prevent a context leak

modifiedReq = modifiedReq.WithContext(ctx)
// // Apply timeout through context
// timeout := time.Duration(config.CFG.BackendTimeoutMs) * time.Millisecond
// ctx, cancel := context.WithTimeout(req.Context(), timeout)
// defer cancel() // Ensure the context is cancelled to prevent a context leak
// modifiedReq = modifiedReq.WithContext(ctx)

startTime := time.Now()
cacheKey := cache.GetCacheKey(req)
Expand Down

0 comments on commit 43dc211

Please sign in to comment.