ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/app/api/debug/clear-redis-cache/route.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/app/api/debug/clear-redis-cache/route.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/app/api/debug/clear-redis-cache/route.ts
Original SHA-256bf496ebc59669f0083316f17781347a6e78d6c5ba1ab02f724e1f4cc1315b398
Git blob SHA2a9cc5a12433f7a884aaaa7a715c682b9680fe51
Reading-copy SHA-256bf496ebc59669f0083316f17781347a6e78d6c5ba1ab02f724e1f4cc1315b398

Original source ↗

Recovered source transcript

import { logger } from '@thedaviddias/logging' import { type NextRequest, NextResponse } from 'next/server' import { ensureDebugAccess } from '@/app/api/debug/_utils' import { CACHE_KEYS, del } from '@/lib/redis' /** * POST handler for clearing Redis cache for a specific user * * @param request - NextRequest containing username in body * @returns Promise resolving to NextResponse with cache clear result or error */ export async function POST(request: NextRequest) { const access = await ensureDebugAccess(request) if (!access.ok) { return access.response } try { const body = await request.json() const { username } = body if (!username) { return NextResponse.json({ error: 'Username parameter required' }, { status: 400 }) } const cacheKey = `${CACHE_KEYS.GITHUB_CONTRIBUTIONS}${username}` const deleted = await del(cacheKey) logger.info('Debug: Clearing Redis cache for contributions', { data: { username, cacheKey, deleted }, tags: { type: 'debug', component: 'redis-cache' } }) return NextResponse.json({ username, cacheKey, deleted, message: deleted ? 'Cache cleared successfully' : 'Cache was not found or already cleared', timestamp: new Date().toISOString() }) } catch (error) { logger.error('Debug: Error clearing Redis cache', { data: { error: error instanceof Error ? error.message : 'Unknown error' }, tags: { type: 'debug', component: 'redis-cache', error: 'clear-failed' } }) return NextResponse.json( { error: 'Failed to clear Redis cache', details: error instanceof Error ? error.message : 'Unknown error', timestamp: new Date().toISOString() }, { status: 500 } ) } }

Search equations, builds, manuscript text, and recovered sources.