vttranlina commented on code in PR #1263:
URL: https://github.com/apache/james-project/pull/1263#discussion_r1002856309


##########
server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc:
##########
@@ -263,13 +263,22 @@ One can filter the above results by status. For example:
 curl -XGET http://ip:port/tasks?status=inProgress
 ....
 
-Will return a list of Execution reports that are currently in progress.
+Will return a list of Execution reports that are currently in progress. This 
list is sorted by
+reverse submitted date (recent tasks goes first).
 
 Response codes:
 
 * 200: A list of corresponding tasks is returned
 * 400: Invalid status value
 
+Additionnal optional task parameters are supported:

Review Comment:
   ```suggestion
   Additional optional task parameters are supported:
   ```



##########
server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java:
##########
@@ -111,6 +113,70 @@ void listShouldReturnTaskDetailsWhenTaskInProgress() 
throws Exception {
             .body("[0].cancelledFrom", nullValue());
     }
 
+    @Test
+    void listShouldBeSorted() throws Exception {
+        TaskId taskId1 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
+        Thread.sleep(10);
+        TaskId taskId2 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
+        Thread.sleep(10);
+        TaskId taskId3 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
+        Thread.sleep(10);

Review Comment:
   why don't we single sleep after 3 submits?
   ```suggestion
           TaskId taskId1 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
           TaskId taskId2 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
           TaskId taskId3 = taskManager.submit(new MemoryReferenceTask(() -> 
Task.Result.COMPLETED));
           Thread.sleep(10);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to