From 45de85416efc58ab599e6ffce1a7b49cdfb867d9 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 20 Dec 2010 17:29:23 +0100 Subject: [PATCH] bacula-web: Optimized last completed and failed jobs - Replaced by CountLastJobs instead of GetLastJobs and GetLastErrorJobs for last 24 hours completed and failed jobs. --- gui/bacula-web/index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index 217d7acd38..c2616eb231 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -96,12 +96,16 @@ $smarty->assign( 'total_name_jobs', $dbSql->Get_BackupJob_Names() ); $smarty->assign('pools', $dbSql->GetVolumeList() ); // Last 24 hours completed jobs number (last_run_report.tpl) -$completed_jobs = $dbSql->GetLastJobs(); -$smarty->assign( 'completed_jobs', $completed_jobs['completed_jobs'] ); +//$completed_jobs = $dbSql->GetLastJobs(); +//$smarty->assign( 'completed_jobs', $completed_jobs['completed_jobs'] ); + +// Last 24 hours completed jobs number (last_run_report.tpl) +$completed_jobs = $dbSql->CountLastJobs( LAST_DAY, 'completed' ); +$smarty->assign( 'completed_jobs', $completed_jobs['job_nb'] ); // Last 24 hours failed jobs number (last_run_report.tpl) -$failed_jobs = $dbSql->GetLastErrorJobs(); -$smarty->assign( 'failed_jobs', $failed_jobs['failed_jobs'] ); +$failed_jobs = $dbSql->CountLastJobs( LAST_DAY, 'failed' ); +$smarty->assign( 'failed_jobs', $failed_jobs['job_nb'] ); // Last 24 hours elapsed time (last_run_report.tpl) $smarty->assign( 'elapsed_jobs', $dbSql->Get_ElapsedTime_Job() ); -- 2.39.2