Skip to content

Commit 3f59147

Browse files
committed
[grid] Make the host selector a field
1 parent 5816af8 commit 3f59147

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public class LocalDistributor extends Distributor {
9797
private static final Json JSON = new Json();
9898
private static final Logger LOG = Logger.getLogger("Selenium Distributor (Local)");
9999
private final ReadWriteLock lock = new ReentrantReadWriteLock(/* fair */ true);
100+
private final HostSelector hostSelector = new DefaultHostSelector();
100101
private final Set<Host> hosts = new HashSet<>();
101102
private final Tracer tracer;
102103
private final EventBus bus;
@@ -180,7 +181,6 @@ public CreateSessionResponse newSession(HttpRequest request)
180181
Lock writeLock = this.lock.writeLock();
181182
writeLock.lock();
182183
try {
183-
HostSelector hostSelector = new DefaultHostSelector();
184184
// Find a host that supports the capabilities present in the new session
185185
Optional<Host> selectedHost = hostSelector.selectHost(firstRequest.getCapabilities(), this.hosts);
186186
// Reserve some space for this session

0 commit comments

Comments
 (0)