* Set a maximum number of messages which may be indexed before we force
authorArt Cancro <ajc@citadel.org>
Sun, 23 Oct 2005 02:56:38 +0000 (02:56 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 23 Oct 2005 02:56:38 +0000 (02:56 +0000)
  a cache flush to disk.  Currently 2500.

citadel/ChangeLog
citadel/serv_fulltext.c
citadel/sysconfig.h

index 5aa931f6c6f81531882931466ae5f84283f1d04c..bc91c24d505d59db98670e386e7ee17e368728da 100644 (file)
@@ -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
index 29ea751cec6d7ca0286695ee4e2059f82fa35ae8..7ed7ed35f87aa2607bc75ab41ec0a98c89e226b8 100644 (file)
@@ -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);
index 545ddfee16a4139b471a83c3bf0ccab8aa49c562..2e285f658f29f5c09ad4f97dc50848d0a1b5b7d1 100644 (file)
 #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
+#