From 9c3817ee14f3bc33b163fe18c5626d091a4a7ac7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 20 May 2025 10:33:55 +0200 Subject: [PATCH] fix(deploy): update resource timestamp handling in deploy_resource method --- app/Http/Controllers/Api/DeployController.php | 7 ++++--- app/Livewire/Project/Database/Heading.php | 9 +++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Api/DeployController.php b/app/Http/Controllers/Api/DeployController.php index 46606e24a..5c7f20902 100644 --- a/app/Http/Controllers/Api/DeployController.php +++ b/app/Http/Controllers/Api/DeployController.php @@ -319,9 +319,10 @@ class DeployController extends Controller default: // Database resource StartDatabase::dispatch($resource); - $resource->update([ - 'started_at' => now(), - ]); + + $resource->started_at ??= now(); + $resource->save(); + $message = "Database {$resource->name} started."; break; } diff --git a/app/Livewire/Project/Database/Heading.php b/app/Livewire/Project/Database/Heading.php index 177bb549c..d5b65bf63 100644 --- a/app/Livewire/Project/Database/Heading.php +++ b/app/Livewire/Project/Database/Heading.php @@ -33,16 +33,13 @@ class Heading extends Component public function activityFinished() { try { - $this->database->update([ - 'started_at' => now(), - ]); + $this->database->started_at ??= now(); + $this->database->save(); if (is_null($this->database->config_hash) || $this->database->isConfigurationChanged()) { $this->database->isConfigurationChanged(true); - $this->dispatch('configurationChanged'); - } else { - $this->dispatch('configurationChanged'); } + $this->dispatch('configurationChanged'); } catch (\Exception $e) { return handleError($e, $this); } finally {