Skip to content

Commit 010a772

Browse files
authored
chore(core): partial discovery cache toggling improvements (#766)
1 parent 2049f6e commit 010a772

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Tempest/Cache/src/CacheConfig.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ private function resolveDiscoveryCacheStrategy(): DiscoveryCacheStrategy
5050
}
5151
}
5252

53-
$current = DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
53+
$cache = env('CACHE');
54+
55+
if ($cache !== null) {
56+
$current = DiscoveryCacheStrategy::make($cache);
57+
} else {
58+
$current = DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
59+
}
5460

5561
if ($current === DiscoveryCacheStrategy::NONE) {
5662
return $current;

src/Tempest/Core/src/Commands/DiscoveryGenerateCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ public function generateDiscoveryCache(DiscoveryCacheStrategy $strategy): void
9191

9292
private function resolveDiscoveryCacheStrategy(): DiscoveryCacheStrategy
9393
{
94+
$cache = env('CACHE');
95+
96+
if ($cache !== null) {
97+
return DiscoveryCacheStrategy::make($cache);
98+
}
99+
94100
return DiscoveryCacheStrategy::make(env('DISCOVERY_CACHE'));
95101
}
96102

0 commit comments

Comments
 (0)