From a987d869ae7276e708da9d45491db0aebd0b3e93 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 18 Jul 2006 02:39:51 +0000 Subject: [PATCH] Fixed a logic bug that caused the full text index to get rebuilt from scratch every time the global system configuration was edited. --- citadel/control.c | 2 +- citadel/serv_fulltext.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/citadel/control.c b/citadel/control.c index 2260fa561..5a7f2e97a 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -431,7 +431,7 @@ void cmd_conf(char *argbuf) /* If full text indexing has been disabled, invalidate the * index so it doesn't try to use it later. */ - if (!config.c_enable_fulltext == 0) { + if (config.c_enable_fulltext == 0) { CitControl.fulltext_wordbreaker = 0; put_control(); } diff --git a/citadel/serv_fulltext.c b/citadel/serv_fulltext.c index 2c23d49dc..9c6f1d896 100644 --- a/citadel/serv_fulltext.c +++ b/citadel/serv_fulltext.c @@ -249,12 +249,16 @@ void do_fulltext_indexing(void) { * If we've switched wordbreaker modules, burn the index and start * over. */ + begin_critical_section(S_CONTROL); + lprintf(CTDL_DEBUG, "wb ver on disk = %d, code ver = %d\n", + CitControl.fulltext_wordbreaker, FT_WORDBREAKER_ID); if (CitControl.fulltext_wordbreaker != FT_WORDBREAKER_ID) { lprintf(CTDL_INFO, "(re)initializing full text index\n"); cdb_trunc(CDB_FULLTEXT); CitControl.MMfulltext = 0L; put_control(); } + end_critical_section(S_CONTROL); /* * Now go through each room and find messages to index. @@ -309,9 +313,11 @@ void do_fulltext_indexing(void) { /* Save our place so we don't have to do this again */ ft_flush_cache(); + begin_critical_section(S_CONTROL); CitControl.MMfulltext = ft_newhighest; CitControl.fulltext_wordbreaker = FT_WORDBREAKER_ID; put_control(); + end_critical_section(S_CONTROL); last_index = time(NULL); lprintf(CTDL_DEBUG, "do_fulltext_indexing() finished\n"); -- 2.39.2