Skip to content

Commit

Permalink
add extended context to begin.Request
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <[email protected]>
  • Loading branch information
NikitaSkrynnik committed Aug 1, 2024
1 parent 515e6bc commit abf4714
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/networkservice/common/begin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ func (b *beginServer) Request(ctx context.Context, request *networkservice.Netwo
}

withEventFactoryCtx := withEventFactory(ctx, eventFactoryServer)
conn, err = next.Server(withEventFactoryCtx).Request(withEventFactoryCtx, request)

newCloseCtx, cancel := context.WithTimeout(context.Background(), time.Minute*3)
defer cancel()
newCloseCtx = extend.WithValuesFromContext(newCloseCtx, withEventFactoryCtx)

conn, err = next.Server(newCloseCtx).Request(newCloseCtx, request)
if err != nil {
if eventFactoryServer.state != established {
eventFactoryServer.state = closed
Expand Down

0 comments on commit abf4714

Please sign in to comment.