Fix Sql messenger table name & bug which meant entries were only received after a 1 min delay
This commit is contained in:
parent
0f99a6c5ca
commit
bd3a4e1ad7
@ -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` > 60)")) {
|
||||
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()) {
|
||||
|
@ -85,6 +85,6 @@ public class SqlMessenger extends AbstractSqlMessenger {
|
||||
|
||||
@Override
|
||||
protected String getTableName() {
|
||||
return this.sqlDao.getPrefix().apply("{prefix}_messages");
|
||||
return this.sqlDao.getPrefix().apply("{prefix}messages");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user