diff options
author | Simon Rettberg | 2022-04-21 17:07:03 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-04-21 17:07:03 +0200 |
commit | 87cade6d92ba75d01d8b61133328a0753e0d7840 (patch) | |
tree | c90853685e9d81dfad6bcaabdaa954897c109515 | |
parent | [client] Fix NPE (diff) | |
download | tutor-module-87cade6d92ba75d01d8b61133328a0753e0d7840.tar.gz tutor-module-87cade6d92ba75d01d8b61133328a0753e0d7840.tar.xz tutor-module-87cade6d92ba75d01d8b61133328a0753e0d7840.zip |
[server] Fix query call (not an update)
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbMailQueue.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbMailQueue.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbMailQueue.java index 479392dc..360f4f6a 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbMailQueue.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbMailQueue.java @@ -39,10 +39,10 @@ public class DbMailQueue { // Delete old mails that got stuck in the queue, optimize table MysqlStatement delStmt = connection.prepareStatement("DELETE FROM mailqueue" + " WHERE UNIX_TIMESTAMP() - dateline > 86400 * 2"); - int cnt = delStmt.executeUpdate(); - if (cnt != 0 || Math.random() < .01) { + delStmt.executeUpdate(); + if (Math.random() < .01) { MysqlStatement optStmt = connection.prepareStatement("OPTIMIZE TABLE mailqueue"); - optStmt.executeUpdate(); + optStmt.execute(); } MysqlStatement stmt = connection.prepareStatement("SELECT" + " mailid, userid, message FROM mailqueue" |