Skip to content

Commit

Permalink
feat: new option 'openBrowserWhenReady'
Browse files Browse the repository at this point in the history
  • Loading branch information
D-D-H committed Nov 17, 2023
1 parent c636aa8 commit 6897a78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions server/server.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ tasks.register('runStandaloneWorker', BootRun) {
classpath(project.sourceSets.main.runtimeClasspath)
mainClass.convention(mainClassName)

args('--jifa.role=standalone-worker', '--jifa.open-browser-when-ready=true')
setJvmOptions(it)
}

Expand All @@ -117,6 +118,7 @@ tasks.register('runStandaloneWorkerWithMysql', BootRun) {
classpath(project.sourceSets.main.runtimeClasspath)
mainClass.convention(mainClassName)

args('--jifa.role=standalone-worker', '--jifa.open-browser-when-ready=true')
setJvmOptions(it)
setDatabase(it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public class Configuration {
*/
private Path[] inputFiles;

/**
* Whether to open browser when server is ready
*/
private boolean openBrowserWhenReady;

@PostConstruct
private void init() {
if (role == Role.MASTER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public void fireReadyEvent() {
}
}

openBrowser("http://localhost:" + config.getPort());
if (config.isOpenBrowserWhenReady()) {
openBrowser("http://localhost:" + config.getPort());
}
}
}

Expand Down

0 comments on commit 6897a78

Please sign in to comment.