Refactor fallback logic for submetrics
- Updated condition to check maxage existence before comparison.
This commit is contained in:
parent
9707a3cfb9
commit
8d0959b21c
@ -78,7 +78,7 @@ if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') {
|
||||
|
||||
|
||||
if(!empty($oldconfig) && empty($submetric['value']) && (isset($submetric['fallback']) && !empty($submetric['fallback']))) {
|
||||
if(time() < ($oldconfig[$key]['submetrics'][$subkey]['time'] + $submetric['fallback']['maxage'])) {
|
||||
if(!isset($submetric['fallback']['maxage']) || time() < ($oldconfig[$key]['submetrics'][$subkey]['time'] + $submetric['fallback']['maxage'])) {
|
||||
if($submetric['fallback']['type'] == 'previous') {
|
||||
$submetric['value'] = $oldconfig[$key]['submetrics'][$subkey]['value'];
|
||||
} elseif ($submetric['fallback']['type'] == 'static') {
|
||||
|
Loading…
Reference in New Issue
Block a user