Retrofit for helpers

This commit is contained in:
Joao Patricio
2023-05-03 07:21:52 +01:00
parent 85af1b4ffb
commit ce9fb38055

36
app/Jobs/CoolifyTask.php Executable file
View File

@@ -0,0 +1,36 @@
<?php
namespace App\Jobs;
use App\Actions\CoolifyTask\RunRemoteProcess;
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;
class HandleCoolifyTaskInQueue implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct(
public Activity $activity,
){}
/**
* Execute the job.
*/
public function handle(): void
{
$remoteProcess = resolve(RunRemoteProcess::class, [
'activity' => $this->activity,
]);
$remoteProcess();
// @TODO: Remove file at $this->activity->getExtraProperty('private_key_location') after process is finished
}
}