Added some more CtdlThreadCheckStop() calls to speed shutdown.
authorDave West <davew@uncensored.citadel.org>
Tue, 18 Mar 2008 21:05:27 +0000 (21:05 +0000)
committerDave West <davew@uncensored.citadel.org>
Tue, 18 Mar 2008 21:05:27 +0000 (21:05 +0000)
citadel/modules/fulltext/serv_fulltext.c

index 522ebe7f58d350a3abc507b08731b31d91198163..4e8ea9b6b77550bd7803bc6c137ba5aa75db6167 100644 (file)
@@ -207,6 +207,9 @@ void ft_index_msg(long msgnum, void *userdata) {
  */
 void ft_index_room(struct ctdlroom *qrbuf, void *data)
 {
+       if (CtdlThreadCheckStop())
+               return;
+               
        getroom(&CC->room, qrbuf->QRname);
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, ft_index_msg, NULL);
 }
@@ -318,8 +321,12 @@ void do_fulltext_indexing(void) {
                ft_newmsgs = NULL;
        }
        end_time = time(NULL);
-       lprintf(CTDL_DEBUG, "do_fulltext_indexing() duration (%ld)\n", end_time - run_time);
 
+       if (CtdlThreadCheckStop())
+               return;
+       
+       lprintf(CTDL_DEBUG, "do_fulltext_indexing() duration (%ld)\n", end_time - run_time);
+               
        /* Save our place so we don't have to do this again */
        ft_flush_cache();
        begin_critical_section(S_CONTROL);