mirror of https://github.com/MISP/MISP
fix: [backgroundJobs] Added default fallback for settings & Use proper filepath when Redis not enabled
parent
6b638085ae
commit
d03dc9c73b
|
@ -89,7 +89,11 @@ abstract class AppShell extends Shell
|
||||||
protected function getBackgroundJobsTool()
|
protected function getBackgroundJobsTool()
|
||||||
{
|
{
|
||||||
if (!isset($this->BackgroundJobsTool)) {
|
if (!isset($this->BackgroundJobsTool)) {
|
||||||
$this->BackgroundJobsTool = new BackgroundJobsTool(Configure::read('SimpleBackgroundJobs'));
|
$settings = ['enabled' => false];
|
||||||
|
if (!empty(Configure::read('SimpleBackgroundJobs.enabled'))) {
|
||||||
|
$settings = Configure::read('SimpleBackgroundJobs');
|
||||||
|
}
|
||||||
|
$this->BackgroundJobsTool = new BackgroundJobsTool($settings);
|
||||||
}
|
}
|
||||||
return $this->BackgroundJobsTool;
|
return $this->BackgroundJobsTool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ class BackgroundJobsTool
|
||||||
}
|
}
|
||||||
RedisTool::unlink($this->RedisConnection, self::DATA_CONTENT_PREFIX . ':' . $uuid);
|
RedisTool::unlink($this->RedisConnection, self::DATA_CONTENT_PREFIX . ':' . $uuid);
|
||||||
return $data;
|
return $data;
|
||||||
} else if ($path[0] === '/') { // deprecated storage location when not full path is provided
|
} else if ($path[0] !== '/') { // deprecated storage location when not full path is provided
|
||||||
$path = APP . 'tmp/cache/ingest' . DS . $path;
|
$path = APP . 'tmp/cache/ingest' . DS . $path;
|
||||||
}
|
}
|
||||||
return JsonTool::decode(FileAccessTool::readAndDelete($path));
|
return JsonTool::decode(FileAccessTool::readAndDelete($path));
|
||||||
|
|
Loading…
Reference in New Issue