From 150fc4e7a2ba43f9a7ecb0ef2552a915b304036e Mon Sep 17 00:00:00 2001 From: Luca Tacconi Date: Thu, 7 Mar 2024 18:11:22 +0100 Subject: [PATCH] Code cleanup --- routes/api/task-stat.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/routes/api/task-stat.php b/routes/api/task-stat.php index 7581929..fdb2192 100644 --- a/routes/api/task-stat.php +++ b/routes/api/task-stat.php @@ -58,9 +58,8 @@ $app_configs = $this->get('configs')["app_configs"]; $base_path =$app_configs["paths"]["base_path"]; - if(empty($_ENV["CRUNZ_BASE_DIR"])){ - $crunz_base_dir = $base_path; - }else{ + $crunz_base_dir = $base_path; + if(!empty($_ENV["CRUNZ_BASE_DIR"])){ $crunz_base_dir = $_ENV["CRUNZ_BASE_DIR"]; } @@ -81,9 +80,8 @@ date_default_timezone_set($crunz_config["timezone"]); - if(empty($forced_task_path)){ - $TASKS_DIR = $crunz_base_dir . "/" . ltrim($crunz_config["source"], "/"); - }else{ + $TASKS_DIR = $crunz_base_dir . "/" . ltrim($crunz_config["source"], "/"); + if(!empty($forced_task_path)){ $TASKS_DIR = $forced_task_path; } @@ -153,6 +151,9 @@ $aLOGNAME_perkey = []; foreach($aLOGNAME_all as $logkey => $logfile){ + + if(substr(basename($logfile), 0, 1) == ".") continue; + $aLOG =explode('_', str_replace($LOGS_DIR."/", "", $logfile)); if( empty($aLOGNAME_perkey[$aLOG[0]]) || count($aLOGNAME_perkey[$aLOG[0]]) == 0 ){