germanoeich/nirn-proxy

no response to request

sdf9s8d76f opened this issue · 2 comments

Hi, so I'm using nirn for webhooks. I noticed that when I exceed the 30 msg/60 sec limit, I don't get a response from the proxy, but instead the request is "loading" for a couple minutes, and then the webhook is executed. Is it possible to immediately return a 429 in such cases and not retry?

this what i get in the logs:
time="2023-07-22T18:47:45Z" level=warning msg="Post "https://discord.com/api/webhooks/1108087402720919663/:token?\": context canceled" clientIp="127.0.0.1:38534" function=Queue waitedFor=6m34.615241937s

That is expected behaviour, the proxy will wait for ratelimits to clear and then fire the request. What you likely want is to implement a timeout on the client side. If you cancel the HTTP request to the proxy, the proxy will cancel the attempt too (unless it has already been sent to discord, ofc). That way you can finely control which webhooks must go through and which are "optional".

thanks for clarification, appreciate the response