Skip to content

Commit

Permalink
[qfix] Use a context with RequestTimeout for requests (#609)
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik authored Mar 28, 2024
1 parent a6e6b23 commit 19c20ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@ func main() {
}

for {
requestCtx, requestCancel := context.WithTimeout(ctx, c.RequestTimeout)
defer requestCancel()

// Construct a request
request := constructRequest(ctx, c, id, &c.NetworkServices[i], monitoredConnections)

resp, err := nsmClient.Request(ctx, request)
resp, err := nsmClient.Request(requestCtx, request)
if err != nil {
logger.Errorf("failed connect to NSMgr: %v", err.Error())
continue
Expand Down

0 comments on commit 19c20ba

Please sign in to comment.