From 57adc425b895fa63cf1b08561e7e8a76f8a327f7 Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 1 Jun 2012 14:54:13 +0200 Subject: [PATCH] minor fix for reindex --- src/Makefile.in | 2 +- src/reindex.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 59137094..e0c02b45 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -88,7 +88,7 @@ install-piler: $(INSTALL) -m 6755 -o $(RUNNING_USER) -g $(RUNNING_GROUP) reindex $(DESTDIR)$(bindir) clean: - rm -f *.o *.a libpiler.so* piler pilerconf pilerget pilerimport pilerexport pilerpurge pilertest + rm -f *.o *.a libpiler.so* piler pilerconf pilerget pilerimport pilerexport pilerpurge pilertest reindex distclean: clean rm -f Makefile diff --git a/src/reindex.c b/src/reindex.c index 985fc99f..96031693 100644 --- a/src/reindex.c +++ b/src/reindex.c @@ -52,7 +52,7 @@ uint64 retrieve_email_by_metadata_id(struct session_data *sdata, uint64 from_id, struct _state state; - snprintf(s, sizeof(s)-1, "SELECT `id`, `piler_id`, `arrived`, `sent` FROM %s WHERE id BETWEEN %llu AND %llu", SQL_METADATA_TABLE, from_id, to_id); + snprintf(s, sizeof(s)-1, "SELECT `id`, `piler_id`, `arrived`, `sent` FROM %s WHERE (id BETWEEN %llu AND %llu) AND `deleted`=0", SQL_METADATA_TABLE, from_id, to_id); rc = mysql_real_query(&(sdata->mysql), s, strlen(s)); @@ -93,8 +93,7 @@ uint64 retrieve_email_by_metadata_id(struct session_data *sdata, uint64 from_id, unlink(filename); - if(progressbar && reindexed % 10 == 0) printf("."); - + if(progressbar && reindexed % 100 == 0) printf("."); } else printf("cannot open: %s\n", filename);