summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2022-04-21 17:07:03 +0200
committerSimon Rettberg2022-04-21 17:07:03 +0200
commit87cade6d92ba75d01d8b61133328a0753e0d7840 (patch)
treec90853685e9d81dfad6bcaabdaa954897c109515
parent[client] Fix NPE (diff)
downloadtutor-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.java6
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"