Skip to content

Commit

Permalink
Duration of concurrent builds fix
Browse files Browse the repository at this point in the history
Duration of concurrent builds should always just be the duration
not the time since the last success.
  • Loading branch information
aabrahamian committed Mar 11, 2018
1 parent e90f7f4 commit c4111ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<artifactId>slack</artifactId>
<packaging>hpi</packaging>
<version>2.4-SNAPSHOT</version>
<version>2.4-SNAPSHOT-alex-2018-03-11-01</version>
<name>Slack Notification Plugin</name>
<description>A Build status publisher that notifies channels on a Slack team</description>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Slack+Plugin</url>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/jenkins/plugins/slack/ActiveNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static String getBuildColor(AbstractBuild r) {
String getBuildStatusMessage(AbstractBuild r, boolean includeTestSummary, boolean includeFailedTests, boolean includeCustomMessage) {
MessageBuilder message = new MessageBuilder(notifier, r);
message.appendStatusMessage();
message.appendDuration();
message.appendDuration(r.getProject().isConcurrentBuild());
message.appendOpenLink();
if (includeTestSummary) {
message.appendTestSummary();
Expand Down Expand Up @@ -389,10 +389,10 @@ public MessageBuilder appendOpenLink() {
return this;
}

public MessageBuilder appendDuration() {
public MessageBuilder appendDuration(boolean isConcurrentBuild) {
message.append(" after ");
String durationString;
if(message.toString().contains(BACK_TO_NORMAL_STATUS_MESSAGE)){
if(!isConcurrentBuild && message.toString().contains(BACK_TO_NORMAL_STATUS_MESSAGE)){
durationString = createBackToNormalDurationString();
} else {
durationString = build.getDurationString();
Expand Down

0 comments on commit c4111ab

Please sign in to comment.