Refactoring: extract process handling from async job.
This commit is contained in:
@@ -3,21 +3,17 @@
|
||||
use App\Services\CoolifyProcess;
|
||||
use Spatie\Activitylog\Contracts\Activity;
|
||||
|
||||
if (! function_exists('coolifyProcess')) {
|
||||
if (! function_exists('remoteProcess')) {
|
||||
|
||||
/**
|
||||
* Run a Coolify Process, which SSH's into a machine to run the command(s).
|
||||
*
|
||||
*/
|
||||
function coolifyProcess($command, $destination): Activity
|
||||
function remoteProcess($command, $destination): Activity
|
||||
{
|
||||
$process = resolve(CoolifyProcess::class, [
|
||||
return resolve(CoolifyProcess::class, [
|
||||
'destination' => $destination,
|
||||
'command' => $command,
|
||||
]);
|
||||
|
||||
$activityLog = $process();
|
||||
|
||||
return $activityLog;
|
||||
])();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user