matobodo / DiscordWebhookLogging

Simple Discord webhook logger
MIT License
8 stars 0 forks source link

sleep should be async #2

Open 3ear opened 9 months ago

3ear commented 9 months ago

assuming the use case is for discord bots, sleep should be sleep from asyncio to prevent locking the whole thread

matobodo commented 9 months ago

I've looked into this issue and the whole send function of logging handler should be running asynchronously, because of the http request to discord api which may also cause delays in case on internet connection issues or discord api issues.

I have currently no time to fix this, maybe next weekend.

matobodo commented 9 months ago

0c0347ef7255e6de9513f63f05c66296e470137a

I have rewritten today part of the handler from scratch, now it's using separate thread to check for buffered messages and send them in the same way as in the last published version.

The sending still needs to be a bit reworked, so until then I'm not publishing this new version. And also the code isn't tested.