Closed Derpius closed 3 years ago
Ok this issue appears intermittent, closing for now until I'm sure this was actually the cause of the issue I observed
It seems the actual cause was sv_hibernate_think
being 0, meaning when the server is in hibernation (no players/bots online) it will stop calling Tick
and Think
hooks among other things like timers not working, meaning messages were delayed until either a player/bot joined, or the relay was stopped which triggers a final manual POST of the cache.
Fixed in 4520850349e348211e4dc6610ff506eff1c9061e
Describe the bug GLua's asynchronous HTTP function cannot handle multiple concurrent requests, which means after the new changes using
HTTP()
for POSTing instead ofhttp.Post
to use a proper post body instead ofx-www-form-urlencoded
which is the only methodhttp.Post
provides, causes theHTTP()
call for Discord message long polling to run sequentially with theHTTP()
call for POSTing.This causes posted messages to be send in between GET long polling, which is 30 seconds from the last poll.
To fix this I'm going to have to use a single
x-www-form-urlencoded
parameter for json, allowing me to usehttp.Post
which runs separately from asyncHTTP()
calls.Additionally, this slowdown of
HTTP()
doesn't appear to affect other GLua addons, as internally the http library merely abstracts calls ofHTTP()
, and yet calling http library methods from insiderelay.lua
doesn't suffer from the same issue as usingHTTP()
.Additional context While low level UDP communication would be far more suited to something like this, requiring a binary module back end for the relay client would increase the complexity (also means I would have to write a protocol for UDP relaying, and implement a multi threaded socket server in python).