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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to