Skip to content

Commit

Permalink
chore: update grpc, http and elastic search request timeouts to 30 se…
Browse files Browse the repository at this point in the history
…conds
  • Loading branch information
anjaliagg9791 committed Oct 4, 2023
1 parent ec9201e commit 892902c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func Serve(
grpc_health_v1.RegisterHealthServer(grpcServer, healthHandler)

// init http proxy
grpcDialCtx, grpcDialCancel := context.WithTimeout(ctx, time.Second*5)
grpcDialCtx, grpcDialCancel := context.WithTimeout(ctx, time.Second*30)
defer grpcDialCancel()

headerMatcher := makeHeaderMatcher(config)
Expand Down Expand Up @@ -160,7 +160,7 @@ func Serve(
mux.WithHTTPTarget(config.addr(), &http.Server{
Handler: gwmux,
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 120 * time.Second,
}),
mux.WithGRPCTarget(config.grpcAddr(), grpcServer),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (repo *DiscoveryRepository) Search(ctx context.Context, cfg asset.SearchCon
search.WithIgnoreUnavailable(true),
search.WithSourceIncludes(returnedAssetFieldsResult...),
search.WithContext(ctx),
search.WithTimeout(30*time.Second),
)
if err != nil {
return nil, asset.DiscoveryError{Op: "Search", Err: fmt.Errorf("execute search: %w", err)}
Expand Down

0 comments on commit 892902c

Please sign in to comment.