mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 04:26:35 +00:00
Move to use WithTimeout instead of WithDeadline for context
These two functions are effectively the same, with the former being a wrapper for the later. Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
@ -11,9 +11,9 @@ func MakeExternalAuthHandler(next http.HandlerFunc, upstreamTimeout time.Duratio
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
req, _ := http.NewRequest(http.MethodGet, upstreamURL, nil)
|
||||
|
||||
deadlineContext, cancel := context.WithDeadline(
|
||||
deadlineContext, cancel := context.WithTimeout(
|
||||
context.Background(),
|
||||
time.Now().Add(upstreamTimeout))
|
||||
upstreamTimeout)
|
||||
|
||||
defer cancel()
|
||||
|
||||
|
Reference in New Issue
Block a user