Skip to content

Commit

Permalink
Merge pull request #692 from asolntsev/postpone-accessing-docker-java
Browse files Browse the repository at this point in the history
#691 postpone initialisation of DockerService until it's really needed
  • Loading branch information
bonigarcia committed Sep 9, 2021
2 parents 459911e + 7693afa commit ccfa282
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
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 @@ -848,7 +847,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 ccfa282

Please sign in to comment.