Skip to content

Commit

Permalink
Allow location of FlowExecutionList.xml to be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Sep 27, 2023
1 parent ca5fddb commit 6a19561
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import hudson.init.TermMilestone;
import hudson.init.Terminator;
import hudson.model.Computer;
import hudson.model.Queue;
import hudson.model.listeners.ItemListener;
import hudson.remoting.SingleLaneExecutorService;
import hudson.util.CopyOnWriteList;
Expand All @@ -37,6 +38,7 @@
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.util.SystemProperties;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.graphanalysis.LinearBlockHoppingScanner;

Expand Down Expand Up @@ -105,7 +107,14 @@ protected FlowExecution computeNext() {
if (configFile == null) {
Jenkins j = Jenkins.getInstanceOrNull();
if (j != null) {
configFile = new XmlFile(new File(j.getRootDir(), FlowExecutionList.class.getName() + ".xml"));
String id = SystemProperties.getString(Queue.class.getName() + ".id");
File f;
if (id != null) {
f = new File(Jenkins.get().getRootDir(), FlowExecutionList.class.getName() + "/" + id + ".xml");
} else {
f = new File(j.getRootDir(), FlowExecutionList.class.getName() + ".xml");
}
configFile = new XmlFile(f);
}
}
return configFile;
Expand Down

0 comments on commit 6a19561

Please sign in to comment.