You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ro...@apache.org on 2019/10/02 15:48:02 UTC

[james-project] 02/04: JAMES-2813 add task type for Migration subtasks

This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit a30e5711a16a6f510acc74918aa221cd7e0ceec4
Author: RĂ©mi KOWALSKI <rk...@linagora.com>
AuthorDate: Wed Oct 2 10:05:14 2019 +0200

    JAMES-2813 add task type for Migration subtasks
---
 .../james/backends/cassandra/migration/Migration.java       | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/Migration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/Migration.java
index 514b7ca..ff5092b 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/Migration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/Migration.java
@@ -20,13 +20,24 @@
 package org.apache.james.backends.cassandra.migration;
 
 import org.apache.james.task.Task;
+import org.apache.james.task.TaskType;
 
 public interface Migration {
 
     void apply() throws InterruptedException;
 
     default Task asTask() {
-        return this::runTask;
+        return new Task() {
+            @Override
+            public Result run() throws InterruptedException {
+                return runTask();
+            }
+
+            @Override
+            public TaskType type() {
+                return TaskType.of("migration_sub_task");
+            }
+        };
     }
 
     default Task.Result runTask() throws InterruptedException {


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