lasthourcloud/app/Jobs/CoolifyTask.php

37 lines
903 B
PHP
Raw Normal View History

2023-03-20 12:04:22 +00:00
<?php
namespace App\Jobs;
2023-05-03 05:15:45 +00:00
use App\Actions\CoolifyTask\RunRemoteProcess;
2023-03-20 12:04:22 +00:00
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Spatie\Activitylog\Models\Activity;
2023-03-20 12:04:22 +00:00
2023-05-03 06:24:34 +00:00
class CoolifyTask implements ShouldQueue
2023-03-20 12:04:22 +00:00
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct(
public Activity $activity,
){}
/**
* Execute the job.
*/
public function handle(): void
2023-03-20 12:04:22 +00:00
{
$remoteProcess = resolve(RunRemoteProcess::class, [
'activity' => $this->activity,
]);
$remoteProcess();
// @TODO: Remove file at $this->activity->getExtraProperty('private_key_location') after process is finished
2023-03-20 12:04:22 +00:00
}
}