Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CauseOfBlockage.print rather than Queue.Item.why #134

Merged
merged 1 commit into from
Jun 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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