summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/tagcache.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 822a84870c..1094c92a97 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2858,7 +2858,7 @@ static bool commit(void)
2858 2858
2859 if (tch.magic != TAGCACHE_MAGIC || rc != len) 2859 if (tch.magic != TAGCACHE_MAGIC || rc != len)
2860 { 2860 {
2861 logf("incorrect header"); 2861 logf("incorrect tmpheader");
2862 close(tmpfd); 2862 close(tmpfd);
2863 remove(TAGCACHE_FILE_TEMP); 2863 remove(TAGCACHE_FILE_TEMP);
2864 return false; 2864 return false;
@@ -2872,6 +2872,9 @@ static bool commit(void)
2872 return true; 2872 return true;
2873 } 2873 }
2874 2874
2875 /* Fully initialize existing headers (if any) before going further. */
2876 tc_stat.ready = check_all_headers();
2877
2875#ifdef HAVE_EEPROM_SETTINGS 2878#ifdef HAVE_EEPROM_SETTINGS
2876 remove(TAGCACHE_STATEFILE); 2879 remove(TAGCACHE_STATEFILE);
2877#endif 2880#endif
@@ -4361,8 +4364,11 @@ static void tagcache_thread(void)
4361 4364
4362#ifdef HAVE_TC_RAMCACHE 4365#ifdef HAVE_TC_RAMCACHE
4363# ifdef HAVE_EEPROM_SETTINGS 4366# ifdef HAVE_EEPROM_SETTINGS
4364 if (firmware_settings.initialized && firmware_settings.disk_clean) 4367 if (firmware_settings.initialized && firmware_settings.disk_clean
4368 && global_settings.tagcache_ram)
4369 {
4365 check_done = tagcache_dumpload(); 4370 check_done = tagcache_dumpload();
4371 }
4366 4372
4367 remove(TAGCACHE_STATEFILE); 4373 remove(TAGCACHE_STATEFILE);
4368# endif 4374# endif
@@ -4376,9 +4382,12 @@ static void tagcache_thread(void)
4376 tc_stat.initialized = true; 4382 tc_stat.initialized = true;
4377 4383
4378 /* Don't delay bootup with the header check but do it on background. */ 4384 /* Don't delay bootup with the header check but do it on background. */
4379 sleep(HZ); 4385 if (!tc_stat.ready)
4380 tc_stat.ready = check_all_headers(); 4386 {
4381 tc_stat.readyvalid = true; 4387 sleep(HZ);
4388 tc_stat.ready = check_all_headers();
4389 tc_stat.readyvalid = true;
4390 }
4382 4391
4383 while (1) 4392 while (1)
4384 { 4393 {