Skip to content

Commit

Permalink
Improved selection of drivers to purge
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <[email protected]>
  • Loading branch information
betterthanclay committed Nov 9, 2023
1 parent 43b7f14 commit c4ee4d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Improved selection of drivers to purge

## v0.2.0 (2023-11-06)
* Added Dovetail config implementation
* Converted PileUpPolicy to enum
Expand Down
4 changes: 3 additions & 1 deletion src/Stash/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use DecodeLabs\Stash;
use DecodeLabs\Stash\Store\Generic as GenericStore;
use DecodeLabs\Veneer;
use ReflectionClass;
use Throwable;

class Context
Expand Down Expand Up @@ -191,7 +192,8 @@ public function loadDriver(
*/
public function purgeAll(): void
{
$drivers = self::DRIVERS + ($this->getConfig()?->getAllDrivers() ?? []);
$drivers = ($this->getConfig()?->getAllDrivers() ?? []);
$drivers[] = (new ReflectionClass($this->loadDriverFor('default')))->getShortName();
$drivers = array_unique($drivers);

foreach ($drivers as $name) {
Expand Down

0 comments on commit c4ee4d6

Please sign in to comment.