]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Avoid doing redundant API calls by job monitor
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 1 Dec 2019 13:28:20 +0000 (14:28 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 15:02:17 +0000 (16:02 +0100)
gui/baculum/protected/Web/Pages/Monitor.php

index 7cea73cc2c10a60920682c4ec6269353c9db8ffc..4308eba2bd8820e18586a1426d784861ff77568d 100644 (file)
  *
  * 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'])) {