Merge pull request #2879 from pterodactyl/fix/backups-failing-early
Allow changing the prune age for backups
This commit is contained in:
commit
2f17e75395
3 changed files with 12 additions and 6 deletions
|
@ -25,11 +25,13 @@ class Kernel extends ConsoleKernel
|
|||
// Execute scheduled commands for servers every minute, as if there was a normal cron running.
|
||||
$schedule->command('p:schedule:process')->everyMinute()->withoutOverlapping();
|
||||
|
||||
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be removed
|
||||
// from the UI view for the server.
|
||||
$schedule->command('p:maintenance:prune-backups', [
|
||||
'--since-minutes' => '30',
|
||||
])->everyThirtyMinutes();
|
||||
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
|
||||
$pruneAge = config('backups.prune_age', 360); // Defaults to 6 hours (time is in minuteS)
|
||||
if ($pruneAge > 0) {
|
||||
$schedule->command('p:maintenance:prune-backups', [
|
||||
'--since-minutes' => $pruneAge,
|
||||
])->everyThirtyMinutes();
|
||||
}
|
||||
|
||||
// Every day cleanup any internal backups of service files.
|
||||
$schedule->command('p:maintenance:clean-service-backups')->daily();
|
||||
|
|
|
@ -52,7 +52,7 @@ class BackupRemoteUploadController extends Controller
|
|||
public function __invoke(Request $request, string $backup)
|
||||
{
|
||||
// Get the size query parameter.
|
||||
$size = (int)$request->query('size');
|
||||
$size = (int) $request->query('size');
|
||||
if (empty($size)) {
|
||||
throw new BadRequestHttpException('A non-empty "size" query parameter must be provided.');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue