Add coolify database and handle exceptions

This commit is contained in:
Andras Bacsai 2024-04-09 11:09:13 +02:00
parent 90ad46b7c5
commit 5e36c37838

View File

@ -41,7 +41,8 @@ class Backup extends Component
}
public function add_coolify_database()
{
$server = Server::find(0);
try {
$server = Server::findOrFail(0);
$out = instant_remote_process(['docker inspect coolify-db'], $server);
$envs = format_docker_envs_to_json($out);
$postgres_password = $envs['POSTGRES_PASSWORD'];
@ -70,6 +71,9 @@ class Backup extends Component
$this->database->refresh();
$this->backup->refresh();
$this->s3s = S3Storage::whereTeamId(0)->get();
} catch (\Exception $e) {
return handleError($e, $this);
}
}
public function backup_now()