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?
optionalcacheNames:string[]
force?
optionalforce:boolean
Variables
cacheCleanupJob
constcacheCleanupJob: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
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; }; }>