Skip to content
Permalink
Browse files
[JENKINS-34716] doPolling and schedulePolling.
  • Loading branch information
jglick committed May 4, 2017
1 parent 0d65617 commit 7963f3791bb5c1ec65103a9d29e8d7d54df895b8
Showing with 26 additions and 0 deletions.
  1. +26 −0 src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
@@ -36,6 +36,7 @@
import hudson.init.Initializer;
import hudson.model.Action;
import hudson.model.BallColor;
import hudson.model.BuildAuthorizationToken;
import hudson.model.BuildableItem;
import hudson.model.Cause;
import hudson.model.Computer;
@@ -623,6 +624,31 @@ public void replaceAction(Action a) {
return typical;
}

// TODO https://github.com/jenkinsci/jenkins/pull/2866 remove override
public boolean schedulePolling() {
if (isDisabled()) {
return false;
}
SCMTrigger scmt = getSCMTrigger();
if (scmt == null) {
return false;
}
scmt.run();
return true;
}

// TODO https://github.com/jenkinsci/jenkins/pull/2866 remove override
@SuppressWarnings("deprecation")
public void doPolling(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (!(this instanceof SCMTriggerItem)) {
rsp.sendError(404);
return;
}
BuildAuthorizationToken.checkPermission((Job) this, getAuthToken(), req, rsp);
schedulePolling();
rsp.sendRedirect(".");
}

@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")
@Override public PollingResult poll(TaskListener listener) {
// TODO call SCMPollListener

0 comments on commit 7963f37

Please sign in to comment.