new: [logging] Log why an event could not be pulled

pull/3771/head
iglocska 2018-10-16 14:05:30 +02:00
parent 35400ef309
commit 91983ffdef
1 changed files with 16 additions and 0 deletions

View File

@ -2039,6 +2039,22 @@ class Server extends AppModel
}
}
}
if (!empty($fails)) {
$this->Log = ClassRegistry::init('Log');
foreach ($fails as $eventid => $message) {
$this->Log->create();
$this->Log->save(array(
'org' => $user['Organisation']['name'],
'model' => 'Server',
'model_id' => $id,
'email' => $user['email'],
'action' => 'pull',
'user_id' => $user['id'],
'title' => 'Failed to pull event #' . $eventid . '.',
'change' => 'Reason:' . $message
));
}
}
if ($jobId) {
$job->saveField('message', 'Pulling proposals.');
}