Add context
This commit adds and passes context around to (almost) every function. This allows cancelling (almost) every function call globally.
This commit is contained in:
parent
996ecb9f80
commit
3455f491ca
104 changed files with 836 additions and 511 deletions
|
|
@ -28,7 +28,7 @@ type Resolver struct {
|
|||
|
||||
func (resolver *Resolver) Routes() []string { return []string{"/go/", "/wisski/get/"} }
|
||||
|
||||
func (resolver *Resolver) Handler(route string, context context.Context, io stream.IOStream) (http.Handler, error) {
|
||||
func (resolver *Resolver) Handler(ctx context.Context, route string, io stream.IOStream) (http.Handler, error) {
|
||||
var err error
|
||||
return resolver.handler.Get(func() (p wdresolve.ResolveHandler) {
|
||||
p.TrustXForwardedProto = true
|
||||
|
|
@ -51,7 +51,7 @@ func (resolver *Resolver) Handler(route string, context context.Context, io stre
|
|||
}
|
||||
|
||||
// start updating prefixes
|
||||
resolver.updatePrefixes(io, context)
|
||||
resolver.updatePrefixes(ctx, io)
|
||||
|
||||
// resolve the prefixes
|
||||
p.Resolver = resolvers.InOrder{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue