mirror of
https://github.com/bytedream/untisbot-discord.git
synced 2025-06-27 00:10:31 +02:00
Bugfix for non sql user
This commit is contained in:
@ -74,16 +74,18 @@ public class DiscordCommandListener extends ListenerAdapter {
|
||||
statsDataConnector = dataConnector.statsConnector();
|
||||
this.languages = languages;
|
||||
|
||||
new Timer().scheduleAtFixedRate(new TimerTask() { // just execute this so that the connect won't have a timeout
|
||||
@Override
|
||||
public void run() {
|
||||
Thread.currentThread().setName("Anti sql timeout");
|
||||
try {
|
||||
Main.getConnection().createStatement().execute("SELECT * FROM Guilds WHERE GUILDID = 0");
|
||||
} catch (SQLException ignore) {
|
||||
if (storeType == StoreType.MARIADB) {
|
||||
new Timer().scheduleAtFixedRate(new TimerTask() { // just execute this so that the connect won't have a timeout
|
||||
@Override
|
||||
public void run() {
|
||||
Thread.currentThread().setName("Anti sql timeout");
|
||||
try {
|
||||
Main.getConnection().createStatement().execute("SELECT * FROM Guilds WHERE GUILDID = 0");
|
||||
} catch (SQLException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 0, TimeUnit.HOURS.toMillis(1));
|
||||
}, 0, TimeUnit.HOURS.toMillis(1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user