mirror of https://github.com/MISP/MISP
fix: [speculative] fix for the event publishing timing issues
parent
2516c25eae
commit
a3f0347a45
|
@ -4300,6 +4300,19 @@ class Event extends AppModel
|
|||
|
||||
public function publishRouter($id, $passAlong = null, $user)
|
||||
{
|
||||
$event = $this->find('first', array(
|
||||
'recursive' => -1,
|
||||
'conditions' => array('Event.id' => $id)
|
||||
));
|
||||
|
||||
if (empty($event)) {
|
||||
return false;
|
||||
}
|
||||
$fieldList = array('published', 'id', 'info', 'publish_timestamp');
|
||||
$event['Event']['published'] = 1;
|
||||
$event['Event']['publish_timestamp'] = time();
|
||||
$this->save($event, array('fieldList' => $fieldList));
|
||||
|
||||
if (Configure::read('MISP.background_jobs')) {
|
||||
|
||||
/** @var Job $job */
|
||||
|
@ -4380,10 +4393,6 @@ class Event extends AppModel
|
|||
'order' => ['id ASC']
|
||||
]);
|
||||
}
|
||||
$fieldList = array('published', 'id', 'info', 'publish_timestamp');
|
||||
$event['Event']['skip_zmq'] = 1;
|
||||
$event['Event']['skip_kafka'] = 1;
|
||||
$this->save($event, array('fieldList' => $fieldList));
|
||||
$userForPubSub = [
|
||||
'id' => 0,
|
||||
'org_id' => $hostOrg['Org']['id'],
|
||||
|
|
Loading…
Reference in New Issue