Files
pterodactyl-panel/app/Console/Kernel.php
T

42 lines
1.4 KiB
PHP
Raw Normal View History

2015-12-06 13:58:49 -05:00
<?php
namespace Pterodactyl\Console;
use Pterodactyl\Models\ActivityLog;
2015-12-06 13:58:49 -05:00
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Database\Console\PruneCommand;
2015-12-06 13:58:49 -05:00
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Pterodactyl\Console\Commands\Schedule\ProcessRunnableCommand;
use Pterodactyl\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
use Pterodactyl\Console\Commands\Maintenance\CleanServiceBackupFilesCommand;
2015-12-06 13:58:49 -05:00
class Kernel extends ConsoleKernel
{
/**
2017-12-17 13:07:38 -06:00
* Register the commands for the application.
2015-12-06 13:58:49 -05:00
*/
2017-12-17 13:07:38 -06:00
protected function commands()
{
$this->load(__DIR__ . '/Commands');
}
2015-12-06 13:58:49 -05:00
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule)
{
// Execute scheduled commands for servers every minute, as if there was a normal cron running.
$schedule->command(ProcessRunnableCommand::class)->everyMinute()->withoutOverlapping();
$schedule->command(CleanServiceBackupFilesCommand::class)->daily();
2021-01-23 14:12:15 -08:00
if (config('backups.prune_age')) {
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
$schedule->command(PruneOrphanedBackupsCommand::class)->everyThirtyMinutes();
2020-12-16 14:15:07 -07:00
}
if (config('activity.prune_days')) {
$schedule->command(PruneCommand::class, ['--model' => [ActivityLog::class]])->daily();
}
2015-12-06 13:58:49 -05:00
}
}