From 8f6d0efd71862f107d51bd53ec70e1311a54d9d3 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 22 May 2022 20:43:31 +0200 Subject: tagtree: Delay showing search progress when ramcache is enabled The disk doesn't need to spin up when the database is in RAM. Results are usually returned without any noticeable delay, so the splash only creates distraction. Change-Id: I04e5b7d2e00f045143dd86e0561091be3d8f9724 --- apps/tagcache.c | 2 +- apps/tagtree.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 436d85812b..8db1569379 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -170,7 +170,7 @@ static const char * const tag_type_str[] = { #endif /* ndef LOGF_ENABLE */ /* Status information of the tagcache. */ -static struct tagcache_stat tc_stat; +struct tagcache_stat tc_stat; /* Queue commands. */ enum tagcache_queue { diff --git a/apps/tagtree.c b/apps/tagtree.c index 45d2bb991b..2694a764a0 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -1429,6 +1429,10 @@ static struct tagentry* get_entries(struct tree_context *tc) return core_get_data(tc->cache.entries_handle); } +#ifdef HAVE_TC_RAMCACHE +extern struct tagcache_stat tc_stat; +#endif + static int retrieve_entries(struct tree_context *c, int offset, bool init) { struct tagcache_search tcs; @@ -1447,6 +1451,9 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) otherwise show it after the normal 1/2 second delay */ show_search_progress( #ifdef HAVE_DISK_STORAGE +#ifdef HAVE_TC_RAMCACHE + tc_stat.ramcache ? true : +#endif storage_disk_is_active() #else true -- cgit v1.2.3