forked from miguel456/rbrecruiter
RSM-81 Fix issues with Options provider
This commit is contained in:
@@ -13,9 +13,12 @@ class Options
|
||||
public function getOption(string $option): string
|
||||
{
|
||||
$value = Cache::get($option);
|
||||
$fromCache = true;
|
||||
|
||||
if (is_null($value))
|
||||
{
|
||||
$fromCache = false;
|
||||
|
||||
Log::debug('Option ' . $option . 'not found in cache, refreshing from database');
|
||||
$value = Option::where('option_name', $option)->first();
|
||||
if (is_null($value))
|
||||
@@ -25,7 +28,9 @@ class Options
|
||||
Cache::put($option . '_desc', 'Undefined description');
|
||||
}
|
||||
|
||||
return $value->option_value;
|
||||
return (!$fromCache)
|
||||
? $value->option_value
|
||||
: $value;
|
||||
}
|
||||
|
||||
public function setOption(string $option, string $value, string $description)
|
||||
|
Reference in New Issue
Block a user