Mercurial > dovecot > core-2.2
changeset 13270:4dff29fbc78d
fts-lucene: Avoid unnecessarily creating the lucene-indexes directory.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 16 Aug 2011 23:12:35 +0300 |
parents | 8aeeaf770612 |
children | ff263750ce71 |
files | src/plugins/fts-lucene/fts-backend-lucene.c src/plugins/fts-lucene/lucene-wrapper.cc |
diffstat | 2 files changed, 4 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/fts-lucene/fts-backend-lucene.c Tue Aug 16 22:53:01 2011 +0300 +++ b/src/plugins/fts-lucene/fts-backend-lucene.c Tue Aug 16 23:12:35 2011 +0300 @@ -89,9 +89,6 @@ backend->selected_box_generation == box->generation_sequence) return 0; - if (fts_backend_lucene_mkdir(backend) < 0) - return -1; - if (box != NULL) { if (fts_lucene_get_mailbox_guid(box, &guid) < 0) return -1; @@ -195,9 +192,6 @@ ctx = i_new(struct lucene_fts_backend_update_context, 1); ctx->ctx.backend = _backend; backend->updating = TRUE; - - if (fts_backend_lucene_mkdir(backend) < 0) - ctx->ctx.failed = TRUE; return &ctx->ctx; } @@ -327,6 +321,8 @@ (struct lucene_fts_backend *)_ctx->backend; if (!ctx->lucene_opened) { + if (fts_backend_lucene_mkdir(backend) < 0) + ctx->ctx.failed = TRUE; if (lucene_index_build_init(backend->index) < 0) ctx->ctx.failed = TRUE; ctx->lucene_opened = TRUE; @@ -505,9 +501,6 @@ (struct lucene_fts_backend *)_backend; int ret; - if (fts_backend_lucene_mkdir(backend) < 0) - return -1; - T_BEGIN { struct hash_table *guids;
--- a/src/plugins/fts-lucene/lucene-wrapper.cc Tue Aug 16 22:53:01 2011 +0300 +++ b/src/plugins/fts-lucene/lucene-wrapper.cc Tue Aug 16 23:12:35 2011 +0300 @@ -789,6 +789,8 @@ { int ret = 0; + if (!IndexReader::indexExists(index->path)) + return 0; if (IndexReader::isLocked(index->path)) IndexReader::unlock(index->path);