movio / bramble

A federated GraphQL API gateway
https://movio.github.io/bramble/
MIT License
497 stars 55 forks source link

Add configuration options for net/http timeouts #229

Closed pkqk closed 7 months ago

pkqk commented 8 months ago

These timeouts should be tuneable for users who don't want to limit downstream services to only accept fast responses.

Address #228 by providing the option to increase the write timeout.

@codedge can you give this a review and see if it addresses your issue, it wasn't able to be configured by the limits plugin as it's the main method that sets up the http.Server instances.

In the config.json you can either provide a default-timeouts map of read, write and idle keys that will be used for all the http.Server instances or override the defaults with gateway-timeouts and private-timeouts maps that only need to provide values differing from the defaults.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (3c1b58b) 71.07% compared to head (71a4e80) 72.24%.

Files Patch % Lines
config.go 41.02% 14 Missing and 9 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #229 +/- ## ========================================== + Coverage 71.07% 72.24% +1.16% ========================================== Files 27 27 Lines 2742 2781 +39 ========================================== + Hits 1949 2009 +60 + Misses 671 631 -40 - Partials 122 141 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codedge commented 8 months ago

Going to check during the day and will let you know.

Thanks already for the fast response!

codedge commented 8 months ago

This works perfectly for me. 👍 Can be merged!