From 1ce6d3bbba8cc844a83a8ca47ca327f45e80bca2 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sun, 6 Dec 2020 13:55:45 -0700 Subject: [PATCH] Maybe we should keep that backup rate-limit --- app/Services/Backups/InitiateBackupService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Backups/InitiateBackupService.php b/app/Services/Backups/InitiateBackupService.php index c7b884537..210e92342 100644 --- a/app/Services/Backups/InitiateBackupService.php +++ b/app/Services/Backups/InitiateBackupService.php @@ -109,13 +109,13 @@ class InitiateBackupService */ public function handle(Server $server, string $name = null, bool $override = false): Backup { - /*$previous = $this->repository->getBackupsGeneratedDuringTimespan($server->id, 10); + $previous = $this->repository->getBackupsGeneratedDuringTimespan($server->id, 10); if ($previous->count() >= 2) { throw new TooManyRequestsHttpException( CarbonImmutable::now()->diffInSeconds($previous->last()->created_at->addMinutes(10)), 'Only two backups may be generated within a 10 minute span of time.' ); - }*/ + } // 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) {