Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -49,13 +49,16 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
|
||||
if ($value === null) {
|
||||
$this->stats['misses']++;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->stats['hits']++;
|
||||
|
||||
return $value->value;
|
||||
} catch (\Throwable) {
|
||||
$this->stats['misses']++;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -91,9 +94,10 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
public function invalidatePattern(string $pattern): int
|
||||
{
|
||||
// Fallback für Cache-Implementierungen ohne Pattern-Support
|
||||
if (!method_exists($this->cache, 'deleteByPattern')) {
|
||||
if (! method_exists($this->cache, 'deleteByPattern')) {
|
||||
// Für einfache Caches: kompletter Clear bei Pattern-Invalidierung
|
||||
$this->clear();
|
||||
|
||||
return 1; // Unbekannte Anzahl, also 1 als Indikator
|
||||
}
|
||||
|
||||
@@ -101,6 +105,7 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
$searchPattern = $this->keyPrefix . '*' . $pattern . '*';
|
||||
$deleted = $this->cache->deleteByPattern($searchPattern);
|
||||
$this->stats['invalidations'] += $deleted;
|
||||
|
||||
return $deleted;
|
||||
} catch (\Throwable) {
|
||||
return 0;
|
||||
@@ -114,6 +119,7 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
if (method_exists($this->cache, 'deleteByTag')) {
|
||||
$deleted = $this->cache->deleteByTag('database_query');
|
||||
$this->stats['invalidations'] += $deleted;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,6 +127,7 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
if (method_exists($this->cache, 'deleteByPattern')) {
|
||||
$deleted = $this->cache->deleteByPattern($this->keyPrefix . '*');
|
||||
$this->stats['invalidations'] += $deleted;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -160,6 +167,7 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
private function calculateHitRatio(): float
|
||||
{
|
||||
$total = $this->stats['hits'] + $this->stats['misses'];
|
||||
|
||||
return $total > 0 ? ($this->stats['hits'] / $total) : 0.0;
|
||||
}
|
||||
|
||||
@@ -171,6 +179,7 @@ final class CacheAdapterStrategy implements CacheStrategy
|
||||
// Wenn TaggedCache verfügbar ist, nutze es
|
||||
if (method_exists($cache, 'tags')) {
|
||||
$taggedCache = $cache->tags($tags);
|
||||
|
||||
return new self($taggedCache, $keyPrefix);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user