Skip to content

Commit

Permalink
[FIXED JENKINS-25473] move config file check as part of loading job t…
Browse files Browse the repository at this point in the history
…o do it in multithread fashion than in a single thread

(cherry picked from commit dc547cf)
  • Loading branch information
N Nachiappan authored and olivergondza committed Dec 21, 2014
1 parent 4629122 commit cca17cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -2603,11 +2603,7 @@ private synchronized TaskBuilder loadTasks() throws IOException {
throw new IOException(projectsDir+" is not a directory");
throw new IOException("Unable to create "+projectsDir+"\nPermission issue? Please create this directory manually.");
}
File[] subdirs = projectsDir.listFiles(new FileFilter() {
public boolean accept(File child) {
return child.isDirectory() && Items.getConfigFile(child).exists();
}
});
File[] subdirs = projectsDir.listFiles();

final Set<String> loadedNames = Collections.synchronizedSet(new HashSet<String>());

Expand Down Expand Up @@ -2653,6 +2649,10 @@ public void run(Reactor session) throws Exception {
for (final File subdir : subdirs) {
g.requires(loadHudson).attains(JOB_LOADED).notFatal().add("Loading job "+subdir.getName(),new Executable() {
public void run(Reactor session) throws Exception {
if(!Items.getConfigFile(subdir).exists()) {
//Does not have job config file, so it is not a jenkins job hence skip it
return;
}
TopLevelItem item = (TopLevelItem) Items.load(Jenkins.this, subdir);
items.put(item.getName(), item);
loadedNames.add(item.getName());
Expand Down

0 comments on commit cca17cc

Please sign in to comment.