From: Art Cancro Date: Sun, 23 Oct 2005 02:56:38 +0000 (+0000) Subject: * Set a maximum number of messages which may be indexed before we force X-Git-Tag: v7.86~4525 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=62cdeb9d64afdbcc569dc8f1cfb53f0405e58d5b * Set a maximum number of messages which may be indexed before we force a cache flush to disk. Currently 2500. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 5aa931f6c..bc91c24d5 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,7 @@ +Sat Oct 22 22:55:49 EDT 2005 ajc +* Set a maximum number of messages which may be indexed before we force + a cache flush to disk. Currently 2500. + Sat Oct 22 00:48:47 EDT 2005 ajc * msgbase.c: allow multipart/alternative part-swapping only at the top level, because if we recursed into another one then it's going to stomp diff --git a/citadel/serv_fulltext.c b/citadel/serv_fulltext.c index 29ea751ce..7ed7ed35f 100644 --- a/citadel/serv_fulltext.c +++ b/citadel/serv_fulltext.c @@ -287,6 +287,13 @@ void do_fulltext_indexing(void) { break; } + /* Check to see if we have to maybe flush to disk */ + if (i >= FT_MAX_CACHE) { + lprintf(CTDL_DEBUG, "Time to flush.\n"); + ft_newhighest = ft_newmsgs[i]; + break; + } + } free(ft_newmsgs); diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 545ddfee1..2e285f658 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -135,3 +135,10 @@ #define CTDL_CER_PATH CTDL_CRYPTO_DIR "/citadel.cer" #define THREADSTACKSIZE 1048576 + +/* + * How many messages may the full text indexer scan before flushing its + * tables to disk? + */ +#define FT_MAX_CACHE 2500 +#