Skip to content

Commit

Permalink
Merge pull request #357 from Jimilian/clean_running_job_from_stupid_m…
Browse files Browse the repository at this point in the history
…istakes

Clean runningJob class from stupid mistakes
  • Loading branch information
rsandell authored Mar 28, 2018
2 parents 76f654c + 056cdd6 commit 1428ff8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2243,8 +2243,8 @@ public void scheduled(ChangeBasedEvent event) {
}

List<ChangeBasedEvent> outdatedEvents = new ArrayList<ChangeBasedEvent>();
Iterator<GerritTriggeredEvent> it = runningJobs.iterator();
synchronized (runningJobs) {
Iterator<GerritTriggeredEvent> it = runningJobs.iterator();
while (it.hasNext()) {
GerritTriggeredEvent runningEvent = it.next();
// Find all entries in runningJobs with the same Change #.
Expand Down Expand Up @@ -2395,7 +2395,7 @@ private boolean checkCausedByGerrit(GerritTriggeredEvent event, Collection<Cause
*/
public boolean remove(ChangeBasedEvent event) {
logger.debug("Removing future job " + event.getPatchSet().getNumber());
return runningJobs.add(event);
return runningJobs.remove(event);
}
}

Expand Down

0 comments on commit 1428ff8

Please sign in to comment.