From 4b9eab89509ad4205d24f34dba9508b38b83990b Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Tue, 22 Dec 2020 19:31:52 -0700 Subject: [PATCH] Send ignored_files as a string to wings --- app/Repositories/Wings/DaemonBackupRepository.php | 3 ++- app/Services/Backups/InitiateBackupService.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Repositories/Wings/DaemonBackupRepository.php b/app/Repositories/Wings/DaemonBackupRepository.php index 6506ac8a2..0eb9d4792 100644 --- a/app/Repositories/Wings/DaemonBackupRepository.php +++ b/app/Repositories/Wings/DaemonBackupRepository.php @@ -2,6 +2,7 @@ namespace Pterodactyl\Repositories\Wings; +use Illuminate\Support\Arr; use Webmozart\Assert\Assert; use Pterodactyl\Models\Backup; use Pterodactyl\Models\Server; @@ -48,7 +49,7 @@ class DaemonBackupRepository extends DaemonRepository 'json' => [ 'adapter' => $this->adapter ?? config('backups.default'), 'uuid' => $backup->uuid, - 'ignored_files' => $backup->ignored_files, + 'ignore' => implode('\n', $backup->ignored_files), ], ] ); diff --git a/app/Services/Backups/InitiateBackupService.php b/app/Services/Backups/InitiateBackupService.php index 0857478ba..615f357ce 100644 --- a/app/Services/Backups/InitiateBackupService.php +++ b/app/Services/Backups/InitiateBackupService.php @@ -117,9 +117,9 @@ class InitiateBackupService } // Check if the server has reached or exceeded it's backup limit - if (!$server->backup_limit || $server->backups()->where('is_successful', true)->count() >= $server->backup_limit) { + if (! $server->backup_limit || $server->backups()->where('is_successful', true)->count() >= $server->backup_limit) { // Do not allow the user to continue if this server is already at its limit and can't override. - if (!$override || $server->backup_limit <= 0) { + if (! $override || $server->backup_limit <= 0) { throw new TooManyBackupsException($server->backup_limit); }