Throw an exception if no cleanup hook was registered.

This commit is contained in:
akwizgran
2021-02-26 11:49:54 +00:00
committed by Torsten Grote
parent f0e4e3c164
commit e4da7968e3

View File

@@ -148,12 +148,9 @@ class CleanupManagerImpl implements CleanupManager, Service, EventListener {
}
CleanupHook hook = hooks.get(cv);
if (hook == null) {
if (LOG.isLoggable(WARNING)) {
LOG.warning("No cleanup hook for " + cv);
}
// Stop the timer so we don't keep trying to delete this message
db.stopCleanupTimer(txn, m);
} else if (hook.deleteMessage(txn, g, m)) {
throw new IllegalStateException("No cleanup hook for " + cv);
}
if (hook.deleteMessage(txn, g, m)) {
Collection<MessageId> messageIds = deleted.get(g);
if (messageIds == null) {
messageIds = new ArrayList<>();