How to change request timeout of Phoenix Endpoint with Bandit

Hello :slight_smile:

I got a stupid question I cannot find a way to increase the default timeout of 60_000 microseconds.
A client of mine is currently uploading zips to my app and the size is currently too big for this default timeout.

After lokking at Bandit docs I put it like this:

config :bazzile, BazzileWeb.Endpoint,
    secret_key_base: secret_key_base,
    url: [host: host, scheme: "https", port: 443],
    check_origin: false,
    http: [
      ip: {0, 0, 0, 0, 0, 0, 0, 0},
      port: port,
      options: [
        read_timeout: 300_000
      ]
    ]

But it is not working. Any clue on this ?

Thanks a lot :slight_smile:

Sorry for the late reply!

The option to set body read timeouts is actually set as part of the Plug.Conn.read_body/2 call; see Plug.Conn β€” Plug v1.14.2 (specifically the read_timeout parameter) for details.

The read_timeout parameter as you’re passing it above (note that the options field has recently changed to thousand_island_options) is concerned with read timeouts for operations not otherwise set via the Plug.Conn API, such as header reading, HTTP/2 frame reading, etc.

1 Like

Thanks a lot :slight_smile:

Hi @ mtrudel
I’m not sure to understand right the documentation and, here, the response.
I do not understand how to configure the timeout ? Do you have an example about how to configure a global project timeout or a route specific timeout ?