Merge pull request 'insert request id in context' (#100) from rq into v3
Some checks failed
build / test (push) Failing after 1m28s
build / lint (push) Failing after 2m45s
codeql / analyze (go) (push) Failing after 3m13s

Reviewed-on: #100
This commit is contained in:
Василий Толстов 2023-08-23 16:32:38 +03:00
commit f163a2de72

View File

@ -40,10 +40,11 @@ var DefaultMetadataFunc = func(ctx context.Context) (context.Context, error) {
} }
imd.Set(DefaultMetadataKey, v) imd.Set(DefaultMetadataKey, v)
omd.Set(DefaultMetadataKey, v) omd.Set(DefaultMetadataKey, v)
ctx = context.WithValue(ctx, XRequestIDKey, v)
ctx = metadata.NewIncomingContext(ctx, imd) ctx = metadata.NewIncomingContext(ctx, imd)
ctx = metadata.NewOutgoingContext(ctx, omd) ctx = metadata.NewOutgoingContext(ctx, omd)
return context.WithValue(ctx, XRequestIDKey, v), nil return ctx, nil
} }
type wrapper struct { type wrapper struct {