ishwi / Chuu

Last.fm bot for discord
MIT License
172 stars 20 forks source link

Possible race condition with !wk update before generating chart #58

Closed b-rad15 closed 2 years ago

b-rad15 commented 3 years ago

Not a huge issue and correct ne if I'm wrong, but from my understanding the !wk and similar commands run an !update silently before generating the image. I ran into a situation today (shown in the screenshot) where the update is successful but the image doesnt reflect the update. then a subsequent !update shows no or one new scrobble but the image reflects what the actual case is. image

ishwi commented 2 years ago

First, sorry for the delay. Then this is not really a bug, because it was the intended behaviour. The commands that update you do that on the background, so the command that triggered the update is more than probable that will finish before the update completes.

This was decided because the update process can take a long time, and it depends on the api latency of last.fm. So I decided to not make it wait for the update, so it does not freeze the command potentially for a long period of time.