Skip to content

Commit 5000963

Browse files
committed
fix: debug cache
1 parent ae53c44 commit 5000963

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Controller/TokenController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ public function showTokens(RequestContextService $ctx): JsonResponse
138138
// Get current user to scope the cache key by roles
139139
$user = $ctx->getCurrentUser();
140140
$rolesKey = md5(serialize($user ? $user->getRoles() : []));
141+
print_r($rolesKey);
141142

142143
// FilesystemAdapter expects an integer TTL (in seconds). 7 days = 604800 seconds
143144
$ttlSeconds = 7 * 24 * 3600;
144145
$cache = new FilesystemAdapter("tokens_{$rolesKey}", $ttlSeconds);
146+
print_r($cache);
145147

146148
// Use callback form as recommended by Symfony cache contracts.
147149
// The callback must return the data to cache (we store the decoded array, not a JsonResponse object).
@@ -150,6 +152,7 @@ public function showTokens(RequestContextService $ctx): JsonResponse
150152
$response = $this->tokenService->getTokens($userAuth);
151153
$content = $response->getContent();
152154
$decoded = json_decode($content, true);
155+
print_r($decoded);
153156
return $decoded ?: [];
154157

155158
// Fallback: if service returns array already

0 commit comments

Comments
 (0)