From 917da9ce36f2269f29b43ebdfd8b875bef6cb09b Mon Sep 17 00:00:00 2001 From: akwizgran Date: Fri, 26 Feb 2021 11:14:40 +0000 Subject: [PATCH] Stop the timer if no hook has been registered. --- .../org/briarproject/bramble/cleanup/CleanupManagerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bramble-core/src/main/java/org/briarproject/bramble/cleanup/CleanupManagerImpl.java b/bramble-core/src/main/java/org/briarproject/bramble/cleanup/CleanupManagerImpl.java index 12bc4e00b..711baa722 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/cleanup/CleanupManagerImpl.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/cleanup/CleanupManagerImpl.java @@ -151,6 +151,8 @@ class CleanupManagerImpl implements CleanupManager, Service, EventListener { 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)) { Collection messageIds = deleted.get(g); if (messageIds == null) { @@ -160,6 +162,7 @@ class CleanupManagerImpl implements CleanupManager, Service, EventListener { messageIds.add(m); } else { LOG.info("Message was not deleted"); + // Stop the timer so we don't keep trying to delete this message db.stopCleanupTimer(txn, m); } }