(control) Also clean up stale 'NEW' messages

This commit is contained in:
Viktor Lofgren 2024-01-15 16:14:02 +01:00
parent ce5ae1931d
commit a1df9e886a

View File

@ -482,7 +482,7 @@ public class MqPersistence {
// Keep 72 hours of messages
var setToDead = conn.prepareStatement("""
DELETE FROM MESSAGE_QUEUE
WHERE STATE IN ('OK', 'DEAD')
WHERE STATE IN ('OK', 'DEAD', 'NEW')
AND (TTL IS NULL OR TTL = 0)
AND TIMESTAMPDIFF(SECOND, UPDATED_TIME, CURRENT_TIMESTAMP(6)) > 72*3600
""")) {