Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd3b778

Browse files
committed
Ensure compatibility with ext-mongodb v2
1 parent948f55e commitcd3b778

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/Symfony/Component/Lock/Store/MongoDbStore.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
useMongoDB\Database;
1818
useMongoDB\Driver\BulkWrite;
1919
useMongoDB\Driver\Command;
20-
useMongoDB\Driver\Exception\WriteException;
20+
useMongoDB\Driver\Exception\BulkWriteException;
2121
useMongoDB\Driver\Manager;
2222
useMongoDB\Driver\Query;
2323
useMongoDB\Exception\DriverRuntimeException;
@@ -236,7 +236,7 @@ public function save(Key $key)
236236

237237
try {
238238
$this->upsert($key,$this->initialTtl);
239-
}catch (WriteException$e) {
239+
}catch (BulkWriteException$e) {
240240
if ($this->isDuplicateKeyException($e)) {
241241
thrownewLockConflictedException('Lock was acquired by someone else.',0,$e);
242242
}
@@ -262,7 +262,7 @@ public function putOffExpiration(Key $key, float $ttl)
262262

263263
try {
264264
$this->upsert($key,$ttl);
265-
}catch (WriteException$e) {
265+
}catch (BulkWriteException$e) {
266266
if ($this->isDuplicateKeyException($e)) {
267267
thrownewLockConflictedException('Failed to put off the expiration of the lock.',0,$e);
268268
}
@@ -348,7 +348,7 @@ private function upsert(Key $key, float $ttl): void
348348
$this->getManager()->executeBulkWrite($this->namespace,$write);
349349
}
350350

351-
privatefunctionisDuplicateKeyException(WriteException$e):bool
351+
privatefunctionisDuplicateKeyException(BulkWriteException$e):bool
352352
{
353353
$code =$e->getCode();
354354

@@ -371,7 +371,7 @@ private function getManager(): Manager
371371
*/
372372
privatefunctioncreateMongoDateTime(float$seconds):UTCDateTime
373373
{
374-
returnnewUTCDateTime($seconds *1000);
374+
returnnewUTCDateTime((int) ($seconds *1000));
375375
}
376376

377377
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp