From 6a7ce569396829c1153520d5e833301e4864a61a Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Mon, 22 Nov 2021 10:27:15 +0100 Subject: [PATCH] chg: [internal] Add job ID to worker --- app/Console/Command/ServerShell.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Console/Command/ServerShell.php b/app/Console/Command/ServerShell.php index 89b535744..23140d64e 100644 --- a/app/Console/Command/ServerShell.php +++ b/app/Console/Command/ServerShell.php @@ -79,6 +79,7 @@ class ServerShell extends AppShell )); foreach ($servers as $serverId => $serverName) { + $jobId = $this->Job->createJob($user, Job::WORKER_DEFAULT, 'pull', "Server: $serverId", 'Pulling.'); $backgroundJobId = $this->getBackgroundJobsTool()->enqueue( BackgroundJobsTool::DEFAULT_QUEUE, BackgroundJobsTool::CMD_SERVER, @@ -86,8 +87,11 @@ class ServerShell extends AppShell 'pull', $user['id'], $serverId, - $technique - ] + $technique, + $jobId, + ], + true, + $jobId ); $this->out("Enqueued pulling from $serverName server as job $backgroundJobId");