mirror of https://github.com/MISP/MISP
chg: [feed] Handle exceptions for ServerShell::enqueueFeedCache
parent
38e2c1cfc2
commit
7d438673c1
|
@ -407,12 +407,26 @@ class ServerShell extends AppShell
|
|||
);
|
||||
$this->Job->save($data);
|
||||
$jobId = $this->Job->id;
|
||||
try {
|
||||
$result = $this->Feed->cacheFeedInitiator($user, $jobId, 'all');
|
||||
} catch (Exception $e) {
|
||||
CakeLog::error($e->getMessage());
|
||||
$result = false;
|
||||
}
|
||||
if ($result) {
|
||||
$this->Job->save(array(
|
||||
'message' => 'Job done.',
|
||||
'progress' => 100,
|
||||
'status' => 4
|
||||
));
|
||||
} else {
|
||||
$this->Job->save(array(
|
||||
'message' => 'Job failed. See logs for more details.',
|
||||
'progress' => 100,
|
||||
'status' => 3,
|
||||
));
|
||||
}
|
||||
|
||||
$this->Task->id = $task['Task']['id'];
|
||||
$this->Task->saveField('message', 'Job completed at ' . date('d/m/Y - H:i:s'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue