use GlobalContext whenever possible (#9280)

This change is throughout the codebase to
ensure that all codepaths honor GlobalContext
This commit is contained in:
Harshavardhana
2020-04-09 09:30:02 -07:00
committed by GitHub
parent 1b45be0d60
commit f44cfb2863
76 changed files with 374 additions and 409 deletions
+4 -5
View File
@@ -17,7 +17,6 @@
package cmd
import (
"context"
"fmt"
"net"
"net/url"
@@ -271,7 +270,7 @@ func hostResolveToLocalhost(endpoint Endpoint) bool {
"host",
endpoint.Hostname(),
)
ctx := logger.SetReqInfo(context.Background(), reqInfo)
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
logger.LogIf(ctx, err, logger.Application)
return false
}
@@ -341,7 +340,7 @@ func (endpoints Endpoints) UpdateIsLocal(foundPrevLocal bool) error {
startTime.Add(timeElapsed),
"elapsed",
""))
ctx := logger.SetReqInfo(context.Background(), reqInfo)
ctx := logger.SetReqInfo(GlobalContext, reqInfo)
logger.LogIf(ctx, err, logger.Application)
}
continue
@@ -368,7 +367,7 @@ func (endpoints Endpoints) UpdateIsLocal(foundPrevLocal bool) error {
"elapsed",
"",
))
ctx := logger.SetReqInfo(context.Background(),
ctx := logger.SetReqInfo(GlobalContext,
reqInfo)
logger.LogIf(ctx, err, logger.Application)
}
@@ -399,7 +398,7 @@ func (endpoints Endpoints) UpdateIsLocal(foundPrevLocal bool) error {
"elapsed",
"",
))
ctx := logger.SetReqInfo(context.Background(),
ctx := logger.SetReqInfo(GlobalContext,
reqInfo)
logger.LogIf(ctx, err, logger.Application)
}