Change timeout threshold for requests
I'm trying to do some big attachment uploads to Discord (like, around the 100MiB Nitro boosted limit), and sometimes the message create requests just timeout with:
Is this hitting a timeout configured on Ktor or is it a Discord limit?
If it's the former (and looking at the stack trace, it looks like it), how can I change it? I assume by tweaking some options in
If it's the former (and looking at the stack trace, it looks like it), how can I change it? I assume by tweaking some options in
HttpClient
's constructor and passing that custom client to Kord?
Thanks! :32 Replies
What is your code for downloading it, also you can change timeouts with the HttpTimeout ktor plugin
it's complicated, but I essentially use
#bodyAsChannel()
and then read chunks using #readAvailable(ByteArray)
the timeout is on the upload though
I will check out that plugin
Forgot to say, this worked!
I used install(HttpTimeout)
on the HttpClient
builder and in it set requestTimeoutMillis
to a fitting amount