Mercurial > moin > 1.9
changeset 981:dbb3bf01ae19
the index rebuild code was in the wrong spot
author | Franz Pletz <fpletz AT franz-pletz DOT org> |
---|---|
date | Mon, 17 Jul 2006 13:12:02 +0200 |
parents | f472ddeba121 |
children | 541271bb8a56 |
files | MoinMoin/search/Xapian.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/search/Xapian.py Mon Jul 17 12:24:58 2006 +0200 +++ b/MoinMoin/search/Xapian.py Mon Jul 17 13:12:02 2006 +0200 @@ -242,12 +242,6 @@ """ fs_rootpage = 'FS' # XXX FS hardcoded - # rebuilding the DB: delete it and add everything - if mode == 'rebuild': - for f in os.listdir(self.dir): - os.unlink(f) - mode = 'add' - try: wikiname = request.cfg.interwikiname or 'Self' itemid = "%s:%s" % (wikiname, os.path.join(fs_rootpage, filename)) @@ -444,6 +438,13 @@ When called in a new thread, lock is acquired before the call, and this method must release it when it finishes or fails. """ + + # rebuilding the DB: delete it and add everything + if mode == 'rebuild': + for f in os.listdir(self.dir): + os.unlink(f) + mode = 'add' + try: writer = xapidx.Index(self.dir, True) writer.configure(self.prefixMap, self.indexValueMap)