Fix Sql messenger table name & bug which meant entries were only received after a 1 min delay

This commit is contained in:
Luck 2018-03-18 18:58:53 +00:00
parent 0f99a6c5ca
commit bd3a4e1ad7
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 2 additions and 2 deletions

View File

@ -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()) {

View File

@ -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");
}
}