mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-04 18:09:37 +01:00
parent
31b57df567
commit
86a15b9a66
@ -71,7 +71,7 @@ public abstract class AbstractSqlMessenger implements Messenger {
|
||||
@Override
|
||||
public void sendOutgoingMessage(@NonNull OutgoingMessage outgoingMessage) {
|
||||
try (Connection c = getConnection()) {
|
||||
try (PreparedStatement ps = c.prepareStatement("INSERT INTO " + getTableName() + "(`time`, `msg`) VALUES(NOW(), ?)")) {
|
||||
try (PreparedStatement ps = c.prepareStatement("INSERT INTO `" + getTableName() + "` (`time`, `msg`) VALUES(NOW(), ?)")) {
|
||||
ps.setString(1, outgoingMessage.asEncodedString());
|
||||
ps.execute();
|
||||
}
|
||||
@ -82,7 +82,7 @@ public abstract class AbstractSqlMessenger implements Messenger {
|
||||
|
||||
public void pollMessages() {
|
||||
try (Connection c = getConnection()) {
|
||||
try (PreparedStatement ps = c.prepareStatement("SELECT `id`, `msg` FROM " + getTableName() + " WHERE `id` > ? AND (NOW() - `time` < 30)")) {
|
||||
try (PreparedStatement ps = c.prepareStatement("SELECT `id`, `msg` FROM `" + getTableName() + "` WHERE `id` > ? AND (NOW() - `time` < 30)")) {
|
||||
ps.setLong(1, this.lastId);
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
@ -101,7 +101,7 @@ public abstract class AbstractSqlMessenger implements Messenger {
|
||||
|
||||
public void runHousekeeping() {
|
||||
try (Connection c = getConnection()) {
|
||||
try (PreparedStatement ps = c.prepareStatement("DELETE FROM " + getTableName() + " WHERE (NOW() - `time` > 60)")) {
|
||||
try (PreparedStatement ps = c.prepareStatement("DELETE FROM `" + getTableName() + "` WHERE (NOW() - `time` > 60)")) {
|
||||
ps.execute();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user