chg: [internal] Add job ID to worker

pull/7975/head
Jakub Onderka 2021-11-22 10:27:15 +01:00
parent d20795b08c
commit 6a7ce56939
1 changed files with 6 additions and 2 deletions

View File

@ -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");