Skip to content

Commit

Permalink
#691 postpone initialing DockerService until it's really needed
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Sep 3, 2021
1 parent 66b5109 commit 7693afa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ protected WebDriverManager() {
httpClient = new HttpClient(config);
downloader = new Downloader(httpClient, config, this::postDownload);
resolutionCache = new ResolutionCache(config);
dockerService = new DockerService(config, httpClient, resolutionCache);
versionDetector = new VersionDetector(config, httpClient);
webDriverList = new CopyOnWriteArrayList<>();
webDriverCreator = new WebDriverCreator(config);
Expand Down Expand Up @@ -845,7 +844,10 @@ public Path getDockerRecordingPath() {
WebDriverBrowser::getRecordingPath);
}

public DockerService getDockerService() {
public synchronized DockerService getDockerService() {
if (dockerService == null) {
dockerService = new DockerService(config, httpClient, resolutionCache);
}
return dockerService;
}

Expand Down

0 comments on commit 7693afa

Please sign in to comment.