* move initialization of context to the top
[citadel.git] / citadel / modules / fulltext / serv_fulltext.c
index 1e461a152785676bc3c2539bb32d188b942db066..f6266e9c4095723b9dded129406a1387c639c12b 100644 (file)
@@ -374,10 +374,10 @@ void do_fulltext_indexing(void) {
 void *indexer_thread(void *arg) {
        struct CitContext indexerCC;
 
-       CtdlLogPrintf(CTDL_DEBUG, "indexer_thread() initializing\n");
 
        CtdlFillSystemContext(&indexerCC, "indexer");
        citthread_setspecific(MyConKey, (void *)&indexerCC );
+       CtdlLogPrintf(CTDL_DEBUG, "indexer_thread() initializing\n");
 
        while (!CtdlThreadCheckStop()) {
                do_fulltext_indexing();
@@ -385,6 +385,7 @@ void *indexer_thread(void *arg) {
        }
 
        CtdlLogPrintf(CTDL_DEBUG, "indexer_thread() exiting\n");
+       CtdlClearSystemContext();
        return NULL;
 }