fix(deploy): update resource timestamp handling in deploy_resource method
This commit is contained in:
parent
35b08453e1
commit
9c3817ee14
2 changed files with 7 additions and 9 deletions
|
|
@ -319,9 +319,10 @@ public function deploy_resource($resource, bool $force = false, int $pr = 0): ar
|
|||
default:
|
||||
// Database resource
|
||||
StartDatabase::dispatch($resource);
|
||||
$resource->update([
|
||||
'started_at' => now(),
|
||||
]);
|
||||
|
||||
$resource->started_at ??= now();
|
||||
$resource->save();
|
||||
|
||||
$message = "Database {$resource->name} started.";
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,16 +33,13 @@ public function getListeners()
|
|||
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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue