Skip to content

Commit

Permalink
[JENKINS-34716] doPolling and schedulePolling.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed May 4, 2017
1 parent 0d65617 commit 7963f37
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7963f37

Please sign in to comment.