(retentionHours: number)
| 413 | } |
| 414 | |
| 415 | async function cleanupFreePlanOrphanedSnapshots(retentionHours: number): Promise<void> { |
| 416 | try { |
| 417 | const retentionDays = Math.floor(retentionHours / 24) |
| 418 | const snapshotsCleaned = await snapshotService.cleanupOrphanedSnapshots(retentionDays + 1) |
| 419 | logger.info(`Cleaned up ${snapshotsCleaned} orphaned snapshots`) |
| 420 | } catch (snapshotError) { |
| 421 | logger.error('Error cleaning up orphaned snapshots:', { snapshotError }) |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | export async function runCleanupLogs(payload: CleanupJobPayload): Promise<void> { |
| 426 | const startTime = Date.now() |
no test coverage detected