Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/jobs/handlers/cache-cleanup-job

lib/jobs/handlers/cache-cleanup-job

Cache Cleanup Job Handler.

This job periodically cleans up expired cache entries to prevent unbounded growth of the cache storage. It removes entries that have expired based on their TTL and performs eviction when the cache size exceeds configured limits.

Interfaces

CacheCleanupJobInput

Properties

cacheNames?

optional cacheNames: string[]

force?

optional force: boolean

Variables

cacheCleanupJob

const cacheCleanupJob: object

Cache cleanup job handler

Type declaration

slug

slug: string = "cache-cleanup"

schedule

schedule: object[]

Run every 6 hours to clean up expired cache entries Cron format: minute hour day month weekday

retries

retries: number = 2

waitUntil

waitUntil: number = 300000

handler()

handler: (context) => Promise<{ output: { success: boolean; totalCleaned: number; totalEvicted: number; duration: number; results: Record<string, unknown>; error?: undefined; }; } | { output: { totalCleaned?: undefined; totalEvicted?: undefined; duration?: undefined; results?: undefined; success: boolean; error: string; }; }>

Parameters
context

JobHandlerContext

Returns

Promise<{ output: { success: boolean; totalCleaned: number; totalEvicted: number; duration: number; results: Record<string, unknown>; error?: undefined; }; } | { output: { totalCleaned?: undefined; totalEvicted?: undefined; duration?: undefined; results?: undefined; success: boolean; error: string; }; }>

Last updated on