Skip to content

Commit

Permalink
Merge pull request #134 from jglick/CauseOfBlockage.print
Browse files Browse the repository at this point in the history
Use CauseOfBlockage.print rather than Queue.Item.why
  • Loading branch information
dwnusbaum authored Jun 12, 2020
2 parents cc78e24 + a97fa56 commit e7c2d46
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import hudson.slaves.OfflineCause;
import hudson.slaves.WorkspaceList;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.Arrays;
Expand Down Expand Up @@ -113,17 +112,17 @@ public boolean start() throws Exception {
@Override public void run() {
Queue.Item item = Queue.getInstance().getItem(task);
if (item != null) {
PrintStream logger;
TaskListener listener;
try {
logger = getContext().get(TaskListener.class).getLogger();
listener = getContext().get(TaskListener.class);
} catch (Exception x) { // IOException, InterruptedException
LOGGER.log(FINE, "could not print message to build about " + item + "; perhaps it is already completed", x);
return;
}
logger.println("Still waiting to schedule task");
String why = item.getWhy();
if (why != null) {
logger.println(why);
listener.getLogger().println("Still waiting to schedule task");
CauseOfBlockage cob = item.getCauseOfBlockage();
if (cob != null) {
cob.print(listener);
}
}
}
Expand Down

0 comments on commit e7c2d46

Please sign in to comment.