From 159100b9446b694db32ee928a61fe22a75a2f05f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 15 Feb 2021 12:17:36 +0100 Subject: [PATCH] tape: ui - avoid changer status query in backup content panel --- src/api2/tape/media.rs | 20 +++++++++++++++----- www/tape/BackupOverview.js | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/api2/tape/media.rs b/src/api2/tape/media.rs index 647cc755..2888aad1 100644 --- a/src/api2/tape/media.rs +++ b/src/api2/tape/media.rs @@ -45,6 +45,11 @@ use crate::{ schema: MEDIA_POOL_NAME_SCHEMA, optional: true, }, + "update-status": { + description: "Try to update tape library status (check what tapes are online).", + optional: true, + default: true, + }, }, }, returns: { @@ -56,17 +61,22 @@ use crate::{ }, )] /// List pool media -pub async fn list_media(pool: Option) -> Result, Error> { +pub async fn list_media( + pool: Option, + update_status: bool, +) -> Result, Error> { let (config, _digest) = config::media_pool::config()?; let status_path = Path::new(TAPE_STATUS_DIR); let catalogs = tokio::task::spawn_blocking(move || { - // update online media status - if let Err(err) = update_online_status(status_path) { - eprintln!("{}", err); - eprintln!("update online media status failed - using old state"); + if update_status { + // update online media status + if let Err(err) = update_online_status(status_path) { + eprintln!("{}", err); + eprintln!("update online media status failed - using old state"); + } } // test what catalog files we have MediaCatalog::media_with_catalogs(status_path) diff --git a/www/tape/BackupOverview.js b/www/tape/BackupOverview.js index 36791a1d..c90d23d7 100644 --- a/www/tape/BackupOverview.js +++ b/www/tape/BackupOverview.js @@ -40,7 +40,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', { loadContent: async function() { let me = this; let content_response = await PBS.Async.api2({ - url: '/api2/extjs/tape/media/list', + url: '/api2/extjs/tape/media/list?update-status=false', }); let data = {};