log error, don't fail
This commit is contained in:
parent
4be61a3982
commit
9d124d65af
1 changed files with 6 additions and 0 deletions
|
@ -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():
|
||||||
|
|
Loading…
Reference in a new issue