Skip to content

Commit

Permalink
Fix JENKINS-12992
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Mar 6, 2012
1 parent 092bff9 commit 3f82eb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/main/java/org/jenkinsci/lib/xtrigger/AbstractTrigger.java
Expand Up @@ -299,7 +299,6 @@ private List<Node> getPollingNodeList(XTriggerLog log) {
}

private List<Node> getPollingNodeListRequiredNoWS(XTriggerLog log) {
log.info("Poll doesn't requires a workspace.");

AbstractProject project = (AbstractProject) job;

Expand All @@ -314,7 +313,6 @@ private List<Node> getPollingNodeListRequiredNoWS(XTriggerLog log) {
}

private List<Node> getPollingNodeListRequiredWS(XTriggerLog log) {
log.info("Poll requires a workspace.");

AbstractProject project = (AbstractProject) job;

Expand Down
Expand Up @@ -28,9 +28,13 @@ public AbstractTriggerByFullContext(String cronTabSpec) throws ANTLRException {
*/
@Override
protected void start(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log) throws XTriggerException {
context = getContext(pollingNode, log);
if (isContextOnStartupFetched()) {
context = getContext(pollingNode, log);
}
}

public abstract boolean isContextOnStartupFetched();

@Override
protected boolean checkIfModified(Node pollingNode, XTriggerLog log) throws XTriggerException {

Expand All @@ -44,6 +48,12 @@ protected boolean checkIfModified(Node pollingNode, XTriggerLog log) throws XTri
return false;
}

if (context == null) {
log.info("Recording context. Check changes in next poll.");
setNewContext(newContext);
return false;
}

boolean changed = checkIfModified(context, newContext, log);
setNewContext(newContext);
return changed;
Expand Down

0 comments on commit 3f82eb7

Please sign in to comment.