Skip to content

Commit c7e0a47

Browse files
refactor: Fix file watcher for livereload
1 parent e710c0a commit c7e0a47

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,6 @@ public static class Livereload {
204204
*/
205205
private List<File> additionalPaths = new ArrayList<>();
206206

207-
/**
208-
* Amount of time to wait between polling for classpath changes.
209-
*/
210-
private Duration pollInterval = Duration.ofSeconds(1);
211-
212-
/**
213-
* Amount of quiet time required without any classpath changes before a reload is
214-
* triggered.
215-
*/
216-
private Duration quietPeriod = Duration.ofMillis(400);
217-
218207
public boolean isEnabled() {
219208
return this.enabled;
220209
}
@@ -239,22 +228,6 @@ public void setAdditionalPaths(List<File> additionalPaths) {
239228
this.additionalPaths = additionalPaths;
240229
}
241230

242-
public Duration getPollInterval() {
243-
return this.pollInterval;
244-
}
245-
246-
public void setPollInterval(Duration pollInterval) {
247-
this.pollInterval = pollInterval;
248-
}
249-
250-
public Duration getQuietPeriod() {
251-
return this.quietPeriod;
252-
}
253-
254-
public void setQuietPeriod(Duration quietPeriod) {
255-
this.quietPeriod = quietPeriod;
256-
}
257-
258231
}
259232

260233
}

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ LiveReloadForAdditionalPaths liveReloadForAdditionalPaths(LiveReloadServer liveR
9999
}
100100

101101
@Bean
102-
FileSystemWatcher fileSystemWatcher(DevToolsProperties properties) {
103-
return new FileSystemWatcher(true, properties.getLivereload().getPollInterval(),
104-
properties.getLivereload().getQuietPeriod());
102+
FileSystemWatcher fileSystemWatcher(DevToolsProperties properties, RestartConfiguration restartConfiguration) {
103+
return restartConfiguration.newFileSystemWatcher();
105104
}
106105

107106
}

0 commit comments

Comments
 (0)