fix: [server:pull] Make sure to update the job progress only if we are

running in a background job
pull/6120/head
mokaddem 2020-07-10 17:59:09 +02:00
parent 978c9612bf
commit 1333dea1fe
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 9 additions and 3 deletions

View File

@ -2699,13 +2699,19 @@ class Server extends AppModel
));
}
}
$job->saveProgress($jobId, 'Pulling proposals.', 50);
if ($jobId) {
$job->saveProgress($jobId, 'Pulling proposals.', 50);
}
$pulledProposals = $eventModel->ShadowAttribute->pullProposals($user, $server);
$job->saveProgress($jobId, 'Pulling sightings.', 75);
if ($jobId) {
$job->saveProgress($jobId, 'Pulling sightings.', 75);
}
$pulledSightings = $eventModel->Sighting->pullSightings($user, $server);
$job->saveProgress($jobId, 'Pull completed.', 100);
if ($jobId) {
$job->saveProgress($jobId, 'Pull completed.', 100);
}
$this->Log = ClassRegistry::init('Log');
$this->Log->create();
$this->Log->save(array(