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

Appearance settings

Commit e286f38

Browse filesBrowse files
alexandre-dauboisnicolas-grekas
authored andcommitted
[Cache] Fix expiration time for CouchbaseCollection
1 parent 1aa17b8 commit e286f38
Copy full SHA for e286f38

File tree

2 files changed

+6
-6
lines changed
Filter options

2 files changed

+6
-6
lines changed

‎src/Symfony/Component/Cache/Adapter/CouchbaseCollectionAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/CouchbaseCollectionAdapter.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CouchbaseCollectionAdapter extends AbstractAdapter
3535
public function __construct(Collection $connection, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
3636
{
3737
if (!static::isSupported()) {
38-
throw new CacheException('Couchbase >= 3.0.0 < 4.0.0 is required.');
38+
throw new CacheException('Couchbase >= 3.0.5 < 4.0.0 is required.');
3939
}
4040

4141
$this->maxIdLength = static::MAX_KEY_LENGTH;
@@ -54,7 +54,7 @@ public static function createConnection(#[\SensitiveParameter] array|string $dsn
5454
}
5555

5656
if (!static::isSupported()) {
57-
throw new CacheException('Couchbase >= 3.0.0 < 4.0.0 is required.');
57+
throw new CacheException('Couchbase >= 3.0.5 < 4.0.0 is required.');
5858
}
5959

6060
set_error_handler(function ($type, $msg, $file, $line): bool { throw new \ErrorException($msg, 0, $type, $file, $line); });
@@ -183,7 +183,7 @@ protected function doSave(array $values, $lifetime): array|bool
183183
}
184184

185185
$upsertOptions = new UpsertOptions();
186-
$upsertOptions->expiry($lifetime);
186+
$upsertOptions->expiry(time() + $lifetime);
187187

188188
$ko = [];
189189
foreach ($values as $key => $value) {

‎src/Symfony/Component/Cache/Tests/Adapter/CouchbaseCollectionAdapterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/CouchbaseCollectionAdapterTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/**
2020
* @requires extension couchbase <4.0.0
21-
* @requires extension couchbase >=3.0.0
21+
* @requires extension couchbase >=3.0.5
2222
*
2323
* @group integration
2424
*
@@ -36,7 +36,7 @@ class CouchbaseCollectionAdapterTest extends AdapterTestCase
3636
public static function setupBeforeClass(): void
3737
{
3838
if (!CouchbaseCollectionAdapter::isSupported()) {
39-
self::markTestSkipped('Couchbase >= 3.0.0 < 4.0.0 is required.');
39+
self::markTestSkipped('Couchbase >= 3.0.5 < 4.0.0 is required.');
4040
}
4141

4242
self::$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
@@ -47,7 +47,7 @@ public static function setupBeforeClass(): void
4747
public function createCachePool($defaultLifetime = 0): CacheItemPoolInterface
4848
{
4949
if (!CouchbaseCollectionAdapter::isSupported()) {
50-
self::markTestSkipped('Couchbase >= 3.0.0 < 4.0.0 is required.');
50+
self::markTestSkipped('Couchbase >= 3.0.5 < 4.0.0 is required.');
5151
}
5252

5353
$client = $defaultLifetime

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.