Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a heartbeat mechanism, and timeouts support #53

merged 3 commits into from Mar 8, 2019


None yet
1 participant
Copy link

dunglas commented Mar 5, 2019

Some reverse proxies kill connections after a (short) period of inactivity. Also, sometimes it's necessary to kill connections after some time to cleanup the memory.

This PR introduces new environment variables to start a heartbeat mechanism (that will prevent reverse proxies and some old browsers to kill the connection), and as well as read and write timeouts.

They are all disabled by default.

  • HEARTBEAT_INTERVAL: interval between heartbeats (useful with some proxies, and old browsers), set to 0s to disable (default), example 15s
  • READ_TIMEOUT: maximum duration for reading the entire request, including the body, set to 0 to disable (default), example: 2m
  • WRITE_TIMEOUT: maximum duration before timing out writes of the response, set to 0 to disable (default), example: 2m

@dunglas dunglas force-pushed the heartbeat branch from 220a23e to d7db60f Mar 5, 2019

@dunglas dunglas changed the title Add a hearthbeat mechanism, and timeouts support Add a heartbeat mechanism, and timeouts support Mar 6, 2019

dunglas added some commits Mar 8, 2019

@dunglas dunglas force-pushed the heartbeat branch from f4302b5 to f0dc175 Mar 8, 2019

@dunglas dunglas merged commit a65ad86 into master Mar 8, 2019

1 check passed

coverage/coveralls Coverage remained the same at 94.552%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.