Michael Larabel
2024-03-02 05:52:41 -06:00
parent fd22d6cb09
commit 5dbaac229a
2 changed files with 7 additions and 7 deletions

View File

@@ -200,7 +200,7 @@ class pts_config
$read_value = str_replace('~/.phoronix-test-suite/', PTS_USER_PATH, $read_value);
}
return !empty($read_value) ? $read_value : $predefined_value;
return (!empty($read_value) || is_numeric($read_value)) ? $read_value : $predefined_value;
}
public static function read_bool_config($xml_pointer, $predefined_value = false, &$nye_xml = null)
{

View File

@@ -378,15 +378,15 @@ class pts_openbenchmarking
$index_cache_ttl = defined('OPENBENCHMARKING_BUILD') ? (1 / 24) : 1;
if(PTS_IS_CLIENT && ($config_ttl = pts_config::read_user_config('PhoronixTestSuite/Options/OpenBenchmarking/IndexCacheTTL')))
{
if($config_ttl === 0)
{
// if the value is 0, only rely upon manual refreshes
continue;
}
else if(is_numeric($config_ttl) && $config_ttl >= 1)
if(is_numeric($config_ttl) && $config_ttl >= 1)
{
$index_cache_ttl = $config_ttl;
}
else
{
// if the value is 0 or garbage, only rely upon manual refreshes
continue;
}
}
if($generated_time > (time() - (86400 * $index_cache_ttl)) && (!defined('FIRST_RUN_ON_PTS_UPGRADE') || FIRST_RUN_ON_PTS_UPGRADE == false))