https://kotlinlang.org logo
#ktor
Title
# ktor
j

Jan

12/29/2021, 6:48 PM
Hello, I'm using ktor for Discord Bot stuff. But somehow sending requests sometimes takes over 5s seconds, and I'm not sure what I am doing wrong. I have a picture of a request log in the thread
(The bot receives an event and should reply in time)
Thats where the 5s come from:
and the task is coming from this:
so inside rateLimiter.queue is the task being run later
As you can see before posting to the endpoint the time is just a few milliseconds after event receiving. Then comes http.post and it somehow takes 5s
using ktor 2 btw but was the same as ktor 1.6
c

Chrimaeon

12/30/2021, 8:16 AM
Is the
404
from your request? Maybe discord is doing something with 404’s. Did you try with CURL and the exact same request?
j

Jan

12/30/2021, 3:07 PM
I tried a different library there I never had problems
2 Views