Skip to content

Commit

Permalink
Leave some time for the API responses to be sent back to the client i…
Browse files Browse the repository at this point in the history
…n their timeouts.
  • Loading branch information
ernestoalejo committed Mar 24, 2024
1 parent d33201b commit da7a798
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func serverOnlyInterceptor() connect.Interceptor {
func genericTimeoutInterceptor() connect.Interceptor {
return connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc {
return connect.UnaryFunc(func(ctx context.Context, in connect.AnyRequest) (connect.AnyResponse, error) {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
ctx, cancel := context.WithTimeout(ctx, 29*time.Second)
defer cancel()
return next(ctx, in)
})
Expand Down

0 comments on commit da7a798

Please sign in to comment.