mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Reduced interval
This commit is contained in:
		@@ -60,6 +60,12 @@ public class MySQL extends Database {
 | 
			
		||||
        this.connection = null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Connection forceConnection() throws SQLException, ClassNotFoundException {
 | 
			
		||||
        Class.forName("com.mysql.jdbc.Driver");
 | 
			
		||||
        this.connection = DriverManager.getConnection("jdbc:mysql://" + this.hostname + ":" + this.port + "/" + this.database, this.user, this.password);
 | 
			
		||||
        return this.connection;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public Connection openConnection() throws SQLException, ClassNotFoundException {
 | 
			
		||||
        if (checkConnection()) {
 | 
			
		||||
 
 | 
			
		||||
@@ -86,13 +86,13 @@ public class SQLManager implements AbstractDB {
 | 
			
		||||
        Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable(){
 | 
			
		||||
            public void run(){
 | 
			
		||||
                try {
 | 
			
		||||
                    connection = PlotMain.getMySQL().openConnection();
 | 
			
		||||
                    connection = PlotMain.getMySQL().forceConnection();
 | 
			
		||||
                }
 | 
			
		||||
                catch (Exception e) {
 | 
			
		||||
                    e.printStackTrace();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }, 500000, 500000);
 | 
			
		||||
        }, 11000, 11000);
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user