changeset 5605:20699dd652ff stable

indexer: skip documents that can't be retrieved - probably because encoding issues (Issue #175) This doesn't fix the encoding issue but it makes it less fatal.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 25 Dec 2015 12:32:47 +0100
parents 74e669d8a479
children 2bf5e8731154
files kallithea/lib/indexers/daemon.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/indexers/daemon.py	Fri Dec 25 12:32:25 2015 +0100
+++ b/kallithea/lib/indexers/daemon.py	Fri Dec 25 12:32:47 2015 +0100
@@ -170,8 +170,12 @@
         Adding doc to writer this function itself fetches data from
         the instance of vcs backend
         """
+        try:
+            node = self.get_node(repo, path, index_rev)
+        except (ChangesetError, NodeDoesNotExistError):
+            log.debug("couldn't add doc - %s did not have %r at %s", repo, path, index_rev)
+            return 0, 0
 
-        node = self.get_node(repo, path, index_rev)
         indexed = indexed_w_content = 0
         # we just index the content of chosen files, and skip binary files
         if node.extension in INDEX_EXTENSIONS and not node.is_binary: