Skip to content

Commit

Permalink
Minor fix in getting latest run
Browse files Browse the repository at this point in the history
  • Loading branch information
manojlds committed Nov 12, 2018
1 parent 080848c commit f2c4508
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.thoughtworks.go.plugin.api.response.DefaultGoPluginApiResponse;
import com.thoughtworks.go.plugin.api.response.GoPluginApiResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public Boolean execute(Run run) {
return run.hasTagOfValue(key, value);
}
});
promotedRuns.sort((o1, o2) -> Long.parseLong(o1.info.end_time) > Long.parseLong(o2.info.end_time) ? 1 : 0);
promotedRuns.sort((o1, o2) -> Long.parseLong(o1.info.end_time) <= Long.parseLong(o2.info.end_time) ? 1 : -1);

return promotedRuns.size() > 0 ? promotedRuns.get(0) : null;
}
Expand Down

0 comments on commit f2c4508

Please sign in to comment.