Skip to content

Commit

Permalink
Merge pull request #41457 from geoand/#32813
Browse files Browse the repository at this point in the history
Provide a configuration option for disabling live-reload
  • Loading branch information
gsmet authored Jun 26, 2024
2 parents 2d02110 + 2bebd8e commit f141eb4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ public void accept(Integer integer) {
StartupAction start = augmentAction.createInitialRuntimeApplication();

runner = start.runMainClass(context.getArgs());
RuntimeUpdatesProcessor.INSTANCE.setConfiguredInstrumentationEnabled(
runner.getConfigValue("quarkus.live-reload.instrumentation", Boolean.class).orElse(false));
RuntimeUpdatesProcessor.INSTANCE
.setConfiguredInstrumentationEnabled(
runner.getConfigValue("quarkus.live-reload.instrumentation", Boolean.class).orElse(false))
.setLiveReloadEnabled(
runner.getConfigValue("quarkus.live-reload.enabled", Boolean.class).orElse(false));
firstStartCompleted = true;
notifyListenersAfterStart();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ public boolean instrumentationEnabled() {
return configuredInstrumentationEnabled;
}

public RuntimeUpdatesProcessor setLiveReloadEnabled(boolean liveReloadEnabled) {
this.liveReloadEnabled = liveReloadEnabled;
return this;
}

public RuntimeUpdatesProcessor setConfiguredInstrumentationEnabled(boolean configuredInstrumentationEnabled) {
this.configuredInstrumentationEnabled = configuredInstrumentationEnabled;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public class LiveReloadConfig {

/**
* Whether the live-reload feature should be enabled.
*/
@ConfigItem(defaultValue = "true")
boolean enabled;

/**
* Whether Quarkus should enable its ability to not do a full restart
* when changes to classes are compatible with JVM instrumentation.
Expand Down

0 comments on commit f141eb4

Please sign in to comment.