load AWS regions and plans dynamically via SDK (#366)

This commit is contained in:
Saeed Vaziry
2024-11-17 00:01:53 +01:00
committed by GitHub
parent deb0b328e3
commit cc79aa9fbf
4 changed files with 121 additions and 30 deletions

View File

@ -15,7 +15,6 @@
use Exception;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
@ -45,7 +44,6 @@ public function create(User $creator, Project $project, array $input): Server
'progress_step' => 'Initializing',
]);
DB::beginTransaction();
try {
if ($server->provider != 'custom') {
$server->provider_id = $input['server_provider'];
@ -70,12 +68,10 @@ public function create(User $creator, Project $project, array $input): Server
// install server
$this->install($server);
DB::commit();
return $server;
} catch (Exception $e) {
$server->provider()->delete();
DB::rollBack();
$server->delete();
throw ValidationException::withMessages([
'provider' => $e->getMessage(),
]);