Skip to content

Commit

Permalink
[JENKINS-54888] Prevent SaveableListener.OnChange() during plugins lo…
Browse files Browse the repository at this point in the history
…ading
  • Loading branch information
hashar committed Jan 11, 2022
1 parent c70e020 commit 49df30f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@

import hudson.Extension;
import hudson.XmlFile;
import hudson.init.InitMilestone;
import hudson.model.Saveable;
import hudson.model.AbstractProject;
import hudson.model.listeners.SaveableListener;

import jenkins.model.Jenkins;

import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -45,6 +48,10 @@ public class SaveableListenerImpl extends SaveableListener {
// for just about any change that happens in Jenkins. This event
// also doesn't provide much detail on what has changed.
public void onChange(Saveable o, XmlFile file) {
if (Jenkins.get().getInitLevel() != InitMilestone.COMPLETED) {
logger.info("Plugins not fully loaded, ignoring change to " + file);
return;
}
// update functions only when gearman-plugin is enabled
if (!GearmanPluginConfig.get().isEnablePlugin()) {
return;
Expand Down

0 comments on commit 49df30f

Please sign in to comment.