You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "tabish121 (via GitHub)" <gi...@apache.org> on 2023/01/30 17:06:28 UTC

[GitHub] [activemq-artemis] tabish121 commented on a diff in pull request #4349: ARTEMIS-3178 Page Limitting (max messages and max bytes)

tabish121 commented on code in PR #4349:
URL: https://github.com/apache/activemq-artemis/pull/4349#discussion_r1090906925


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java:
##########
@@ -179,11 +182,13 @@ public void close(PageSubscription cursor) {
    }
 
    @Override
-   public void scheduleCleanup() {
+   public Future<Boolean> scheduleCleanup() {
+      final SimpleFutureImpl<Boolean> future = new SimpleFutureImpl<>();
       if (!cleanupEnabled || scheduledCleanup.intValue() > 2) {
          // Scheduled cleanup was already scheduled before.. never mind!
          // or we have cleanup disabled
-         return;
+         pagingStore.execute(() -> future.set(true));

Review Comment:
   Is there a reason why you need to fire off a task into the executor just to return a completed future?  Seems simpler to just return CompletableFuture.completedFuture or just complete this one and return it directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org