An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor: Remove unnecessary code in DatabaseBackupJob and BackupExecutions
Andras Bacsaicb39544808c9
diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.phpindex 16a66c3959..0666f78c31 100644--- a/app/Jobs/DatabaseBackupJob.php+++ b/app/Jobs/DatabaseBackupJob.php@@ -101,7 +101,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue}BackupCreated::dispatch($this->team->id);-+$status = str(data_get($this->database, 'status'));if (! $status->startsWith('running') && $this->database->id !== 0) {ray('database not running');@@ -391,7 +391,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue{try {$commands[] = 'mkdir -p '.$this->backup_dir;- $backupCommand = "docker exec";+ $backupCommand = 'docker exec';if ($this->postgres_password) {$backupCommand .= " -e PGPASSWORD=$this->postgres_password";}@@ -468,7 +468,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueueif ($this->backup->number_of_backups_locally === 0) {$deletable = $this->backup->executions()->where('status', 'success');} else {- $deletable = $this->backup->executions()->where('status', 'success')->orderByDesc('created_at')->skip($this->backup->number_of_backups_locally - 1);+ $deletable = $this->backup->executions()->where('status', 'success')->skip($this->backup->number_of_backups_locally - 1);}foreach ($deletable->get() as $execution) {delete_backup_locally($execution->filename, $this->server);diff --git a/app/Livewire/Project/Database/BackupExecutions.php b/app/Livewire/Project/Database/BackupExecutions.phpindex de1bac36fc..c9db7f5fcb 100644--- a/app/Livewire/Project/Database/BackupExecutions.php+++ b/app/Livewire/Project/Database/BackupExecutions.php@@ -58,7 +58,7 @@ class BackupExecutions extends Componentpublic function refreshBackupExecutions(): void{if ($this->backup) {- $this->executions = $this->backup->executions()->get()->sortBy('created_at');+ $this->executions = $this->backup->executions()->get();}}}