Skip to content

Commit fcc24ef

Browse files
ludochgae-java-bot
authored andcommitted
Modified JettyContainerService.java to set the file scanner depth to unlimited (-1) in the local development server. This was an ancient regression after removing Jetty9 where the API was different.
PiperOrigin-RevId: 911441764 Change-Id: I88aba07e4fce174568551ee0517e0316a53ba85e
1 parent 310a6e2 commit fcc24ef

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

runtime/local_jetty121/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ protected void stopHotDeployScanner() throws Exception {
461461
}
462462

463463
private class ScannerListener implements Scanner.DiscreteListener {
464+
private boolean firstChange = true;
465+
464466
@Override
465467
public void fileAdded(String filename) throws Exception {
466468
// trigger a reload
@@ -469,6 +471,12 @@ public void fileAdded(String filename) throws Exception {
469471

470472
@Override
471473
public void fileChanged(String filename) throws Exception {
474+
if (firstChange) {
475+
firstChange = false;
476+
log.atInfo().log(
477+
"Ignoring first change to %s to avoid spurious reload on startup.", filename);
478+
return;
479+
}
472480
log.atInfo().log("%s updated, reloading the webapp!", filename);
473481
reloadWebApp();
474482
}
@@ -505,7 +513,7 @@ private void fullWebAppScanner(int interval) throws IOException {
505513
scanner.setScanInterval(interval);
506514
scanner.setScanDirs(scanList);
507515
scanner.setReportExistingFilesOnStartup(false);
508-
scanner.setScanDepth(3);
516+
scanner.setScanDepth(-1); // -1 means unlimited depth.
509517

510518
scanner.addListener(
511519
new Scanner.BulkListener() {

0 commit comments

Comments
 (0)