Skip to content

Commit b69fa3f

Browse files
committed
Make sure we can remove deferred hierarchial items
1 parent ee63587 commit b69fa3f

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

src/PredisCachePool.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ protected function clearAllObjectsFromCache()
4949

5050
protected function clearOneObjectFromCache($key)
5151
{
52+
// We have to commit here to be able to remove deferred hierarchy items
53+
$this->commit();
54+
5255
$keyString = $this->getHierarchyKey($key, $path);
5356
$this->cache->incr($path);
5457
$this->clearHierarchyKeyCache();

tests/CreatePoolTrait.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of php-cache\predis-adapter package.
5+
*
6+
* (c) 2015-2015 Aaron Scherer <[email protected]>, Tobias Nyholm <[email protected]>
7+
*
8+
* This source file is subject to the MIT license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
312
namespace Cache\Adapter\Predis\Tests;
413

514
use Cache\Adapter\Predis\PredisCachePool;
@@ -22,4 +31,4 @@ private function getClient()
2231

2332
return $this->client;
2433
}
25-
}
34+
}

tests/IntegrationHierarchyTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Cache\Adapter\Predis\Tests;
1313

14-
use Cache\Adapter\Predis\PredisCachePool;
1514
use Cache\IntegrationTests\HierarchicalCachePoolTest;
16-
use Predis\Client;
1715

1816
class IntegrationHierarchyTest extends HierarchicalCachePoolTest
1917
{

tests/IntegrationPoolTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Cache\Adapter\Predis\Tests;
1313

14-
use Cache\Adapter\Predis\PredisCachePool;
1514
use Cache\IntegrationTests\CachePoolTest;
16-
use Predis\Client;
1715

1816
class IntegrationPoolTest extends CachePoolTest
1917
{

tests/IntegrationTagTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Cache\Adapter\Predis\Tests;
1313

14-
use Cache\Adapter\Predis\PredisCachePool;
1514
use Cache\IntegrationTests\TaggableCachePoolTest;
16-
use Predis\Client;
1715

1816
class IntegrationTagTest extends TaggableCachePoolTest
1917
{

0 commit comments

Comments
 (0)