EssentialsX

EssentialsX

2M Downloads

Deposit Method is Lagging

Superalex0102 opened this issue ยท 4 comments

commented

Type of bug

Performance issue or memory leak

/ess version output

You're running the latest EssentialsX dev build!

Server startup log

EssentialsX config files

Error log (if applicable)

Bug description

Hey!
I'm still having issues with the deposit method from EssentialsX
https://spark.lucko.me/KzsBXy9Y9a
Previously I got the response that "the author of that plugin uses incorrectly", the plugin is now open sourced, here is the code how it deposits the money, why is this "incorrect"?
https://github.com/OmerBenGera/WildChests/blob/master/src/main/java/com/bgsoftware/wildchests/handlers/ProvidersHandler.java#L163

Steps to reproduce

Expected behaviour

Actual behaviour

commented

Looks like right here https://github.com/OmerBenGera/WildChests/blob/43de5837a73a3dba5e614ab983e0b68bd1f54f98/src/main/java/com/bgsoftware/wildchests/utils/ChestUtils.java#L105
the plugin is attempting to run that method in a loop, which if done for any significant amount of time will cause the problem.

This can only be fixed with the other plugin in question.

commented

Looks like right here https://github.com/OmerBenGera/WildChests/blob/43de5837a73a3dba5e614ab983e0b68bd1f54f98/src/main/java/com/bgsoftware/wildchests/utils/ChestUtils.java#L105
the plugin is attempting to run that method in a loop, which if done for any significant amount of time will cause the problem.

This can only be fixed with the other plugin in question.

No... When calling startSellingTask, the deposit isn't called, but the money to be deposited is cached. then, when calling stopSellingTask, it will deposit the cached amount only once. Therefore, the loop you're talking about isn't really happening. And even if it did, then your system should still handle that.

commented

The lag comes from this line:

Even tho you write the changes async, the yaml dump is still called on the main thread, causing a lot of lag to the server when depositing money to players.

commented

Duplicate of #2466