Abstracted deployment code into a job.
This commit is contained in:
@@ -3,15 +3,23 @@
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
class PollActivity extends Component
|
||||
{
|
||||
public $activity;
|
||||
public $isKeepAliveOn = true;
|
||||
public $deployment_uuid;
|
||||
|
||||
public function polling()
|
||||
{
|
||||
$this->activity?->refresh();
|
||||
if ( is_null($this->activity) && isset($this->deployment_uuid)) {
|
||||
$this->activity = Activity::where('properties->deployment_uuid', '=', $this->deployment_uuid)
|
||||
->first();
|
||||
} else {
|
||||
$this->activity?->refresh();
|
||||
}
|
||||
|
||||
if (data_get($this->activity, 'properties.exitCode') !== null) {
|
||||
$this->isKeepAliveOn = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user