RonanPlugins / BetterRTP

Official wiki of the BetterRTP plugin!
https://www.spigotmc.org/resources/36081/
MIT License
111 stars 86 forks source link

Make sql querys async #115

Closed Zoltus closed 1 year ago

Zoltus commented 1 year ago

Messaged to u at spigot month ago but no response so here again

You should always execute sql querys async, which you are not doing. It can be a huge problem! For example querys in public List getInRange(QueueRangeData range) arent async.

SuperRonanCraft commented 1 year ago

I can assure you all sql querys are called Async, the reason they are not EXPLICITELY called async is cause the majority of these are called in a method that is already running Async. You can check, in RTPPlayer, the getApplicable is called async from the RTPPlayer class ;)

Zoltus commented 1 year ago

getInRange

If you execute CmdInfo#execute it calls infoGetWorld which calls QueueHandler.getApplicableAsync(_rtpworld).size()); which class DatabaseHandler.getQueue().getInRange(new DatabaseQueue.QueueRangeData(rtpWorld));

And mayby im blind but I cant see where it turns into async there. I hope its async, I just have hard time tracking the code. If you want to doublecheck that and let me know where the async call is made:)

SuperRonanCraft commented 1 year ago

Oh, well that info command is harmless, only admins have access to it and only used when setting up. I will fix that up though, simple fix luckily. Thanks for pointing that out

Zoltus commented 1 year ago

Oh, well that info command is harmless, only admins have access to it and only used when setting up. I will fix that up though, simple fix luckily. Thanks for pointing that out

Np:)

SuperRonanCraft commented 1 year ago

took me long enough...