# HG changeset patch # User Marcin Kuzminski # Date 2010-09-01 10:13:03 # Node ID c59c4d4323e7ba54d5728233c149f48b13560562 # Parent 9fe5ca6d72f606337ad509423d2664b1e456dc56 added support for broken symlinks in whoosh indexer diff --git a/pylons_app/lib/indexers/daemon.py b/pylons_app/lib/indexers/daemon.py --- a/pylons_app/lib/indexers/daemon.py +++ b/pylons_app/lib/indexers/daemon.py @@ -86,13 +86,24 @@ class WhooshIndexingDaemon(object): log.debug(' >> %s' % path) #just index file name without it's content u_content = u'' - - writer.add_document(owner=unicode(repo.contact), + + + + try: + os.stat(path) + writer.add_document(owner=unicode(repo.contact), repository=u"%s" % repo.name, path=u"%s" % path, content=u_content, modtime=os.path.getmtime(path), - extension=ext) + extension=ext) + except OSError, e: + import errno + if e.errno == errno.ENOENT: + log.debug('path %s does not exist or is a broken symlink' % path) + else: + raise e + def build_index(self): if os.path.exists(IDX_LOCATION):