]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9715 use realistic JSW timouts
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 30 Aug 2017 14:30:55 +0000 (16:30 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 5 Sep 2017 12:24:13 +0000 (14:24 +0200)
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java
server/sonar-server/src/main/resources/org/sonar/server/ce/ws/activity_status-example.json
server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java
sonar-application/src/main/assembly/conf/wrapper.conf
sonar-ws/src/main/protobuf/ws-ce.proto

index 9348e275e491800a234dbb3bc7cfd1d7884155c3..cf395d10e34037c9387596fc2962a58b1673c6b6 100644 (file)
@@ -20,6 +20,7 @@
 package org.sonar.server.ce.ws;
 
 import com.google.common.base.Optional;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -69,6 +70,8 @@ public class ActivityStatusAction implements CeWsAction {
     action.createParam(PARAM_COMPONENT_KEY)
       .setDescription("Key of the component (project) to filter on")
       .setExampleValue(KeyExamples.KEY_PROJECT_EXAMPLE_001);
+
+    action.setChangelog(new Change("6.6", "New field 'inProgress' in response"));
   }
 
   @Override
@@ -83,10 +86,12 @@ public class ActivityStatusAction implements CeWsAction {
       String componentUuid = component.isPresent() ? component.get().uuid() : null;
       checkPermissions(component);
       int pendingCount = dbClient.ceQueueDao().countByStatusAndComponentUuid(dbSession, CeQueueDto.Status.PENDING, componentUuid);
+      int inProgressCount = dbClient.ceQueueDao().countByStatusAndComponentUuid(dbSession, CeQueueDto.Status.IN_PROGRESS, componentUuid);
       int failingCount = dbClient.ceActivityDao().countLastByStatusAndComponentUuid(dbSession, CeActivityDto.Status.FAILED, componentUuid);
 
       return ActivityStatusWsResponse.newBuilder()
         .setPending(pendingCount)
+        .setInProgress(inProgressCount)
         .setFailing(failingCount)
         .build();
     }
index 979c171c1d240b33d59e751a0cded4980220c255..01b223801ab864670269e5ac9e0bfe9ff9935d9e 100644 (file)
@@ -66,6 +66,7 @@ public class ActivityStatusActionTest {
   public void json_example() {
     dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-1").setStatus(CeQueueDto.Status.PENDING));
     dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-2").setStatus(CeQueueDto.Status.PENDING));
+    dbClient.ceQueueDao().insert(dbSession, newCeQueueDto("ce-queue-uuid-3").setStatus(CeQueueDto.Status.IN_PROGRESS));
     for (int i = 0; i < 5; i++) {
       dbClient.ceActivityDao().insert(dbSession, new CeActivityDto(newCeQueueDto("ce-activity-uuid-" + i))
         .setStatus(CeActivityDto.Status.FAILED));
index 64d66eacbdb2fdfc8f38a070145a5fcbe5fe3f12..3f37ed2fb46a4c799e52be1f8187b40f94cd69c2 100644 (file)
@@ -85,5 +85,5 @@ wrapper.ntservice.interactive=false
 #********************************************************************
 wrapper.disable_restarts=TRUE
 wrapper.ping.timeout=0
-wrapper.shutdown.timeout=3000
-wrapper.jvm_exit.timeout=3000
+wrapper.shutdown.timeout=300
+wrapper.jvm_exit.timeout=15
index dd869eaa1c35fab81b5d79a7004ea0934c925b5a..a268b7bcbd6847522845269c670bd67abd1e9014 100644 (file)
@@ -48,6 +48,7 @@ message ActivityResponse {
 message ActivityStatusWsResponse {
   optional int32 pending = 1;
   optional int32 failing = 2;
+  optional int32 inProgress = 3;
 }
 
 // GET api/ce/component