fix: run user commands on high prio queue

This commit is contained in:
Andras Bacsai
2024-06-25 10:51:32 +02:00
parent f8c5a35b56
commit 58fc897ea5
6 changed files with 41 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire;
use App\Actions\Server\RunCommand as ServerRunCommand;
use App\Models\Server;
use Livewire\Component;
@@ -33,7 +34,7 @@ class RunCommand extends Component
{
$this->validate();
try {
$activity = remote_process([$this->command], Server::where('uuid', $this->server)->first(), ignore_errors: true);
$activity = ServerRunCommand::run(server: Server::where('uuid', $this->server)->first(), command: $this->command);
$this->dispatch('activityMonitor', $activity->id);
} catch (\Throwable $e) {
return handleError($e, $this);