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
This commit is contained in:
Christian Soffke 2022-05-22 20:43:31 +02:00 committed by Solomon Peachy
parent cf37676fb1
commit 8f6d0efd71
2 changed files with 8 additions and 1 deletions

View file

@ -170,7 +170,7 @@ static const char * const tag_type_str[] = {
#endif /* ndef LOGF_ENABLE */ #endif /* ndef LOGF_ENABLE */
/* Status information of the tagcache. */ /* Status information of the tagcache. */
static struct tagcache_stat tc_stat; struct tagcache_stat tc_stat;
/* Queue commands. */ /* Queue commands. */
enum tagcache_queue { enum tagcache_queue {

View file

@ -1429,6 +1429,10 @@ static struct tagentry* get_entries(struct tree_context *tc)
return core_get_data(tc->cache.entries_handle); 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) static int retrieve_entries(struct tree_context *c, int offset, bool init)
{ {
struct tagcache_search tcs; 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 */ otherwise show it after the normal 1/2 second delay */
show_search_progress( show_search_progress(
#ifdef HAVE_DISK_STORAGE #ifdef HAVE_DISK_STORAGE
#ifdef HAVE_TC_RAMCACHE
tc_stat.ramcache ? true :
#endif
storage_disk_is_active() storage_disk_is_active()
#else #else
true true