mirror of https://github.com/MISP/MISP
chg: remove hardcode response, map shell/cmd names.
parent
35cf34fab2
commit
9bb95db27e
|
@ -390,8 +390,7 @@ class EventShell extends AppShell
|
|||
$user = $this->getUser($userId);
|
||||
$job = $this->Job->read(null, $jobId);
|
||||
$this->Event->Behaviors->unload('SysLogLogable.SysLogLogable');
|
||||
// $result = $this->Event->publish($id, $passAlong);
|
||||
$result = true;
|
||||
$result = $this->Event->publish($id, $passAlong);
|
||||
$job['Job']['progress'] = 100;
|
||||
$job['Job']['status'] = Job::STATUS_COMPLETED;
|
||||
$job['Job']['date_modified'] = date("Y-m-d H:i:s");
|
||||
|
|
|
@ -68,10 +68,14 @@ class BackgroundJobsTool
|
|||
self::UPDATE_QUEUE,
|
||||
];
|
||||
|
||||
public const CMD_EVENT_SHELL = 'event';
|
||||
public const CMD_EVENT = 'event';
|
||||
|
||||
public const ALLOWED_COMMANDS = [
|
||||
self::CMD_EVENT_SHELL
|
||||
self::CMD_EVENT
|
||||
];
|
||||
|
||||
public const CMD_TO_SHELL_DICT = [
|
||||
self::CMD_EVENT => 'EventShell'
|
||||
];
|
||||
|
||||
public const JOB_STATUS_PREFIX = 'job_status';
|
||||
|
@ -130,7 +134,7 @@ class BackgroundJobsTool
|
|||
): string {
|
||||
|
||||
if ($this->settings['use_resque']) {
|
||||
$this->resqueEnqueue($queue, $command, $args, $trackStatus, $job);
|
||||
$this->resqueEnqueue($queue, self::CMD_TO_SHELL_DICT[$command], $args, $trackStatus, $job);
|
||||
}
|
||||
|
||||
$this->validateQueue($queue);
|
||||
|
|
|
@ -4553,7 +4553,7 @@ class Event extends AppModel
|
|||
|
||||
return $this->getBackgroundJobsTool()->enqueue(
|
||||
BackgroundJobsTool::PRIO_QUEUE,
|
||||
BackgroundJobsTool::CMD_EVENT_SHELL,
|
||||
BackgroundJobsTool::CMD_EVENT,
|
||||
[
|
||||
'publish',
|
||||
$id,
|
||||
|
|
Loading…
Reference in New Issue