log error, don't fail

This commit is contained in:
j 2022-02-15 14:56:29 +01:00
parent 4be61a3982
commit 9d124d65af

View file

@ -1,3 +1,4 @@
import logging
import os import os
import subprocess import subprocess
import tempfile import tempfile
@ -5,6 +6,9 @@ import tempfile
from django.conf import settings from django.conf import settings
logger = logging.getLogger('pandora.' + __name__)
def extract_text(pdf, page=None): def extract_text(pdf, page=None):
if page is not None: if page is not None:
page = str(page) page = str(page)
@ -66,6 +70,8 @@ class FulltextMixin:
res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type=self._ES_DOC_TYPE, id=self.id) res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type=self._ES_DOC_TYPE, id=self.id)
except NotFoundError: except NotFoundError:
pass pass
except:
logger.error('failed to delete fulltext document', exc_info=True)
def update_fulltext(self): def update_fulltext(self):
if self.has_fulltext_key(): if self.has_fulltext_key():