mysql close in scheduler

Discussion in 'Plugin Development' started by confuserr, Sep 16, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    confuserr

    So I have a ban plugin which uses MySQL to store the bans. I've had a few users saying that if the database connection is slow, it takes a while to connect. Are there any downsides to closing the connection in an async scheduler say every few minutes rather than closing it after each onPlayerLogin event? That way it would re-use the connection when multiple players login within seconds of each other.

    Or would it be better to store all the banned users in a List and update that list every X seconds/minutes and check to see if there name is in it? Only downfall to this is that my plugin supports cross server bans, so there would be a delay from when a player is banned on Server A to being banned on Server B.
     
Thread Status:
Not open for further replies.

Share This Page