Skip to content

Commit

Permalink
do I need this?
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Jan 24, 2025
1 parent 1833251 commit 31cce30
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ public Future<Boolean> scheduleCleanup() {

return future;
}
public Future<Boolean> forceScheduleCleanup() {
final SimpleFutureImpl<Boolean> future = new SimpleFutureImpl<>();

pagingStore.execute(() -> {
storageManager.setContext(storageManager.newSingleThreadContext());
try {
System.out.println("Forcing cleanup");
if (cleanupEnabled) {
cleanup();
}
} finally {
storageManager.clearContext();
future.set(true);
}
});

return future;
}


/**
* Delete everything associated with any queue on this address.
Expand Down Expand Up @@ -272,6 +291,7 @@ protected void cleanup() {
}

if (pagingStore.hasPendingIO()) {
forceScheduleCleanup();
return;
}

Expand Down

0 comments on commit 31cce30

Please sign in to comment.