Skip to content

Commit

Permalink
chore(core): partial discovery cache toggling improvements (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt authored Nov 25, 2024
1 parent 2049f6e commit 010a772
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Tempest/Cache/src/CacheConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ private function resolveDiscoveryCacheStrategy(): DiscoveryCacheStrategy
}
}

$current = DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
$cache = env('CACHE');

if ($cache !== null) {
$current = DiscoveryCacheStrategy::make($cache);
} else {
$current = DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
}

if ($current === DiscoveryCacheStrategy::NONE) {
return $current;
Expand Down
6 changes: 6 additions & 0 deletions src/Tempest/Core/src/Commands/DiscoveryGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public function generateDiscoveryCache(DiscoveryCacheStrategy $strategy): void

private function resolveDiscoveryCacheStrategy(): DiscoveryCacheStrategy
{
$cache = env('CACHE');

if ($cache !== null) {
return DiscoveryCacheStrategy::make($cache);
}

return DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
}

Expand Down

0 comments on commit 010a772

Please sign in to comment.