aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/core/jenkins/JenkinsBuildPoller.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/core/jenkins/JenkinsBuildPoller.java b/src/main/java/io/trygvis/esper/testing/core/jenkins/JenkinsBuildPoller.java
index 38152e0..6a7e1b4 100755
--- a/src/main/java/io/trygvis/esper/testing/core/jenkins/JenkinsBuildPoller.java
+++ b/src/main/java/io/trygvis/esper/testing/core/jenkins/JenkinsBuildPoller.java
@@ -15,6 +15,8 @@ import org.slf4j.*;
import java.io.*;
import java.sql.*;
import java.util.*;
+import java.util.HashSet;
+import java.util.Set;
import static fj.data.Option.*;
import static io.trygvis.esper.testing.Config.*;
@@ -98,6 +100,8 @@ public class JenkinsBuildPoller implements TablePoller.NewRowCallback<JenkinsBui
int knownPersons = 0, unknownPersons = 0;
+ Set<Uuid> insertedParticipants = new HashSet<>();
+
for (UUID user : jenkinsBuild.users) {
SqlOption<PersonDto> personO = daos.personDao.selectPersonByJenkinsUuid(user);
@@ -111,6 +115,12 @@ public class JenkinsBuildPoller implements TablePoller.NewRowCallback<JenkinsBui
knownPersons++;
Uuid person = personO.get().uuid;
+
+ if (!insertedParticipants.add(person)) {
+ logger.info("Participant already inserted, person={}", person);
+ continue;
+ }
+
logger.info("Created build participant, person={}", person);
buildDao.insertBuildParticipant(uuidBuild, person);
}