wip
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Livewire\Project\Application;
|
||||
|
||||
use App\Enums\ActivityTypes;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use Livewire\Component;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
@@ -14,7 +15,7 @@ class PollDeployment extends Component
|
||||
|
||||
public function polling()
|
||||
{
|
||||
if ( is_null($this->activity) && isset($this->deployment_uuid)) {
|
||||
if (is_null($this->activity) && isset($this->deployment_uuid)) {
|
||||
$this->activity = Activity::query()
|
||||
->where('properties->type', '=', ActivityTypes::DEPLOYMENT->value)
|
||||
->where('properties->type_uuid', '=', $this->deployment_uuid)
|
||||
@@ -23,7 +24,7 @@ class PollDeployment extends Component
|
||||
$this->activity?->refresh();
|
||||
}
|
||||
|
||||
if (data_get($this->activity, 'properties.status') == 'finished' || data_get($this->activity, 'properties.status') == 'failed' ) {
|
||||
if (data_get($this->activity, 'properties.status') == 'finished' || data_get($this->activity, 'properties.status') == 'failed') {
|
||||
$this->isKeepAliveOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,14 @@ namespace App\Jobs;
|
||||
use App\Models\Application;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ContainerStatusJob implements ShouldQueue
|
||||
class ContainerStatusJob implements ShouldQueue, ShouldBeUnique
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
@@ -19,6 +20,10 @@ class ContainerStatusJob implements ShouldQueue
|
||||
public string|null $container_id = null,
|
||||
) {
|
||||
}
|
||||
public function uniqueId(): string
|
||||
{
|
||||
return $this->container_id;
|
||||
}
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -6,19 +6,18 @@ use App\Actions\CoolifyTask\RunRemoteProcess;
|
||||
use App\Data\CoolifyTaskArgs;
|
||||
use App\Enums\ActivityTypes;
|
||||
use App\Models\Application;
|
||||
use App\Models\InstanceSettings;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Illuminate\Support\Str;
|
||||
use Spatie\Url\Url;
|
||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||
|
||||
class DeployApplicationJob implements ShouldQueue
|
||||
{
|
||||
@@ -35,9 +34,15 @@ class DeployApplicationJob implements ShouldQueue
|
||||
protected $env_args;
|
||||
public static int $batch_counter = 0;
|
||||
public $timeout = 3600;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [new WithoutOverlapping($this->application_uuid)];
|
||||
}
|
||||
public function uniqueId(): string
|
||||
{
|
||||
return $this->application_uuid;
|
||||
}
|
||||
public function __construct(
|
||||
public string $deployment_uuid,
|
||||
public string $application_uuid,
|
||||
|
||||
Reference in New Issue
Block a user