latest update with cron job for deleting orphan videos

This commit is contained in:
ghassan committed 2026-04-05 03:49:50 +03:00
1 parent 2a562b99f1
commit d44490dfe0
4 files changed
+134 -1

No files matched your search

+13 -1
View File
@@ -12,7 +12,11 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
$interval = $this->getCleanupInterval();
$schedule->command('cleanup:orphaned-videos --force')
->cron("*/{$interval} * * * *")
->withoutOverlapping()
->runInBackground();
}
/**
@@ -24,4 +28,12 @@ class Kernel extends ConsoleKernel
require base_path('routes/console.php');
}
/**
* Get the interval in minutes for cleanup (from .env)
*/
protected function getCleanupInterval(): int
{
return (int) env('CLEANUP_INTERVAL_MINUTES', 30);
}
}