else {
lprintf(CTDL_ALERT, "Invalid token %d !!\n", tok);
}
-
- /* FIXME do we need to unlock the file here? */
}
free(tokens);
void ft_index_room(struct ctdlroom *qrbuf, void *data)
{
getroom(&CC->room, qrbuf->QRname);
- CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, ft_index_msg, NULL);
+ CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, ft_index_msg, NULL);
}
* 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.
/* 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");