From: Marcin Haba Date: Sun, 1 Dec 2019 13:28:20 +0000 (+0100) Subject: baculum: Avoid doing redundant API calls by job monitor X-Git-Tag: Release-9.6.0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae70526380934776bea7715e320b0947ea5b3960;p=thirdparty%2Fbacula.git baculum: Avoid doing redundant API calls by job monitor --- diff --git a/gui/baculum/protected/Web/Pages/Monitor.php b/gui/baculum/protected/Web/Pages/Monitor.php index 7cea73cc2..4308eba2b 100644 --- a/gui/baculum/protected/Web/Pages/Monitor.php +++ b/gui/baculum/protected/Web/Pages/Monitor.php @@ -19,10 +19,15 @@ * * Bacula(R) is a registered trademark of Kern Sibbald. */ - Prado::using('Application.Web.Class.BaculumWebPage'); -class Monitor extends BaculumWebPage { +/** + * Monitor class. + * + * NOTE: It must inherit from BaculumPage, not from BaculumWebPage, + * because this way it has not any redundant API request from BaculumWebPage. + */ +class Monitor extends BaculumPage { const DEFAULT_MAX_JOBS = 10000; @@ -38,6 +43,9 @@ class Monitor extends BaculumWebPage { 'error' => array('error' => 0, 'output' => '') ); + // Initialize session cache to have clear session for Monitor + $this->getModule('api')->initSessionCache(true); + $web_config = $this->getModule('web_config')->getConfig(); $job_limit = self::DEFAULT_MAX_JOBS; if (count($web_config) > 0 && key_exists('max_jobs', $web_config['baculum'])) {