File tree 1 file changed +1
-14
lines changed
src/Symfony/Component/Lock/Store
1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,6 @@ class MongoDbStore implements BlockingStoreInterface
54
54
private $ options ;
55
55
private $ initialTtl ;
56
56
57
- private $ readPreference ;
58
-
59
57
use ExpiringStoreTrait;
60
58
61
59
/**
@@ -263,7 +261,7 @@ public function exists(Key $key): bool
263
261
'$gt ' => $ this ->createMongoDateTime (microtime (true )),
264
262
],
265
263
], [
266
- 'readPreference ' => $ this -> getReadPreference ( ),
264
+ 'readPreference ' => new ReadPreference ( defined (ReadPreference:: PRIMARY ) ? ReadPreference:: PRIMARY : ReadPreference:: RP_PRIMARY ),
267
265
]);
268
266
}
269
267
@@ -317,17 +315,6 @@ private function isDuplicateKeyException(WriteException $e): bool
317
315
return 11000 === $ code ;
318
316
}
319
317
320
- private function getReadPreference (): ReadPreference
321
- {
322
- if (null !== $ this ->readPreference ) {
323
- return $ this ->readPreference ;
324
- }
325
-
326
- $ this ->readPreference = new ReadPreference (ReadPreference::RP_PRIMARY );
327
-
328
- return $ this ->readPreference ;
329
- }
330
-
331
318
private function getCollection (): Collection
332
319
{
333
320
if (null !== $ this ->collection ) {
You can’t perform that action at this time.
0 commit comments