]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8831 increase performance of bulk issue storage
authorDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 22 Feb 2017 10:58:00 +0000 (11:58 +0100)
committerGitHub <noreply@github.com>
Wed, 22 Feb 2017 10:58:00 +0000 (11:58 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/IssueStorage.java

index 199d8a6d6733a3f90f8e1313c8e1350ac9b20ad3..1aacf9eb27c0399e35a1934506db57f47c327e4b 100644 (file)
@@ -100,10 +100,11 @@ public abstract class IssueStorage {
       if (issue.isNew()) {
         doInsert(session, now, issue);
         insertChanges(issueChangeMapper, issue);
+        count++;
         if (count > BatchSession.MAX_BATCH_SIZE) {
           session.commit();
+          count = 0;
         }
-        count++;
       } else if (issue.isChanged()) {
         toBeUpdated.add(issue);
       }