james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [01/14] james-project git commit: JAMES-2551 Run cleanUp tasks in parallel
Date Fri, 05 Oct 2018 11:12:44 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 12d825a96 -> eec12864d


JAMES-2551 Run cleanUp tasks in parallel


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/b885ac25
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b885ac25
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b885ac25

Branch: refs/heads/master
Commit: b885ac25f5d171ea7d1ce2cfc2ea49062211f543
Parents: 12d825a
Author: Benoit Tellier <btellier@linagora.com>
Authored: Thu Oct 4 17:32:40 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Fri Oct 5 18:10:32 2018 +0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/james/CleanupTasksPerformer.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b885ac25/server/container/guice/guice-common/src/main/java/org/apache/james/CleanupTasksPerformer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/CleanupTasksPerformer.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/CleanupTasksPerformer.java
index d0c99f9..0fcbdb9 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/CleanupTasksPerformer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/CleanupTasksPerformer.java
@@ -24,6 +24,7 @@ import java.util.Set;
 import javax.inject.Inject;
 
 import org.apache.james.task.Task;
+import org.apache.james.util.Runnables;
 
 public class CleanupTasksPerformer {
 
@@ -39,7 +40,10 @@ public class CleanupTasksPerformer {
     }
 
     public void clean() {
-        cleanupTasks.forEach(Task::run);
+        Runnables
+            .runParrallelStream(
+                cleanupTasks.stream()
+                    .map(cleanupTask -> cleanupTask::run));
     }
 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message