(jobType: CleanupJobType)
| 186 | } |
| 187 | |
| 188 | async function buildCleanupRunner(jobType: CleanupJobType): Promise<EnqueueOptions['runner']> { |
| 189 | const cleanupRunner = await (async () => { |
| 190 | switch (jobType) { |
| 191 | case 'cleanup-logs': |
| 192 | return (await import('@/background/cleanup-logs')).runCleanupLogs |
| 193 | case 'cleanup-soft-deletes': |
| 194 | return (await import('@/background/cleanup-soft-deletes')).runCleanupSoftDeletes |
| 195 | case 'cleanup-tasks': |
| 196 | return (await import('@/background/cleanup-tasks')).runCleanupTasks |
| 197 | } |
| 198 | })() |
| 199 | return ((payload) => cleanupRunner(payload as CleanupJobPayload)) as EnqueueOptions['runner'] |
| 200 | } |
| 201 | |
| 202 | /** Job type → plan whose housekeeping is global, not per-workspace. */ |
| 203 | const GLOBAL_HOUSEKEEPING_PLAN: Partial<Record<CleanupJobType, PlanCategory>> = { |
no outgoing calls
no test coverage detected