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() {
|
public void pollMessages() {
|
||||||
try (Connection c = getConnection()) {
|
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);
|
ps.setLong(1, this.lastId);
|
||||||
try (ResultSet rs = ps.executeQuery()) {
|
try (ResultSet rs = ps.executeQuery()) {
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
@ -85,6 +85,6 @@ public class SqlMessenger extends AbstractSqlMessenger {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTableName() {
|
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