From d97ba72f34466dfe9c0d05ada7c79abc08aa5f6b Mon Sep 17 00:00:00 2001 From: Mahad Kalam Date: Wed, 10 Dec 2025 17:43:46 +0000 Subject: [PATCH] Remove the useless UUID checks! --- app/Jobs/DatabaseBackupJob.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index 533090770..f8817576c 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -298,16 +298,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue $this->backup_dir = backup_dir().'/coolify'."/coolify-db-$ip"; } foreach ($databasesToBackup as $database) { - // Generate unique UUID for each database backup execution - $attempts = 0; - do { - $this->backup_log_uuid = (string) new Cuid2; - $exists = ScheduledDatabaseBackupExecution::where('uuid', $this->backup_log_uuid)->exists(); - $attempts++; - if ($attempts >= 3 && $exists) { - throw new \Exception('Unable to generate unique UUID for backup execution after 3 attempts'); - } - } while ($exists); + $this->backup_log_uuid = (string) new Cuid2; $size = 0; $localBackupSucceeded = false; @@ -696,15 +687,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue $backupType = $this->backup->pgbackrest_backup_type ?: 'full'; $this->container_name = $this->database->uuid; - $attempts = 0; - do { - $this->backup_log_uuid = (string) new Cuid2; - $exists = ScheduledDatabaseBackupExecution::where('uuid', $this->backup_log_uuid)->exists(); - $attempts++; - if ($attempts >= 3 && $exists) { - throw new \Exception('Unable to generate unique UUID for backup execution after 3 attempts'); - } - } while ($exists); + $this->backup_log_uuid = (string) new Cuid2; $this->backup_log = ScheduledDatabaseBackupExecution::create([ 'uuid' => $this->backup_log_uuid,