The plugin is using the main server thread.
erik1988 opened this issue ยท 5 comments
Title says it all, its not recommended to use the main server thread for stuff like this, consequentially the plugin autosaveworld is warning us about this.
[16:39:20] [Server thread/WARN]: [AutoSaveWorld] Plugin ChestShopNotifier attempted to establish connection socket://localhost:3306 in main server thread
Could this be fixed?
Thanks.
On which action in the plugin does that occur? Afaik a lot is already running in its own thread. (Besides enabling and disabling obviously)
Thanks for your reply.
I do not know specifically but I see this warning allot and it seems to only be when its connecting to SQL, sometimes it will show up many times i a row too.
This instance is from when the server is started:
[14:08:43] [Server thread/INFO]: [ChestShopNotifier] Enabling ChestShopNotifier v1.1.5
[14:08:43] [Server thread/INFO]: [ChestShopNotifier] Connecting to the database...
[14:08:43] [Server thread/WARN]: [AutoSaveWorld] Plugin ChestShopNotifier attempted to establish connection socket://localhost:3306 in main server thread
[14:08:43] [Server thread/INFO]: [ChestShopNotifier] Connecting to the database...
[14:08:43] [Server thread/WARN]: [AutoSaveWorld] Plugin ChestShopNotifier attempted to establish connection socket://localhost:3306 in main server thread
[14:08:43] [Server thread/INFO]: [ChestShopNotifier] Connected!
And this one just happens randomly:
[18:54:59] [Server thread/WARN]: [AutoSaveWorld] Plugin ChestShopNotifier attempted to establish connection socket://localhost:3306 in main server thread
The last one happens many times, if you add autosaveworld as a plugin you will be able to see for yourself.
I dont know much about coding but I looked at how logblock handels mysql and noticed that they use "implements" instead of "extends". Could that be the reason?
LOGBLOCK: public class MySQLConnectionPool implements Closeable {
CSN: public class MySQL extends Database {