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

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

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


##########
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:
   Yes... I wanted to make sure any previous call to cleanup was finished. Say you called scheduleCleanup a couple of times.. then you call scheduleCleanup again...
   
   
    I don't need to schedule another one as I already have a call scheduled, but I want to return a Future that will be released after these calls have finished.



-- 
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