mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
small changes
This commit is contained in:
parent
cb2340539d
commit
391020a2b0
@ -223,9 +223,9 @@ class Consumer(LoggingMixin):
|
|||||||
self.log("debug", "Deleting file {}".format(self.path))
|
self.log("debug", "Deleting file {}".format(self.path))
|
||||||
os.unlink(self.path)
|
os.unlink(self.path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ConsumerError(e)
|
self._send_progress(self.filename, 100, 100, 'FAILED',
|
||||||
self._send_progress(file, 100, 100, 'FAILED',
|
|
||||||
"Failed: {}".format(e))
|
"Failed: {}".format(e))
|
||||||
|
raise ConsumerError(e)
|
||||||
finally:
|
finally:
|
||||||
document_parser.cleanup()
|
document_parser.cleanup()
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ class Consumer(LoggingMixin):
|
|||||||
"Document {} consumption finished".format(document)
|
"Document {} consumption finished".format(document)
|
||||||
)
|
)
|
||||||
|
|
||||||
self._send_progress(file, 100, 100, 'SUCCESS',
|
self._send_progress(self.filename, 100, 100, 'SUCCESS',
|
||||||
'Finished.', document.id)
|
'Finished.', document.id)
|
||||||
|
|
||||||
return document
|
return document
|
||||||
|
@ -143,6 +143,15 @@ TEMPLATES = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
CHANNEL_LAYERS = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
||||||
|
"CONFIG": {
|
||||||
|
"hosts": ["redis://localhost:6379"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Security #
|
# Security #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -376,12 +385,3 @@ for t in json.loads(os.getenv("PAPERLESS_FILENAME_PARSE_TRANSFORMS", "[]")):
|
|||||||
# TODO: this should not have a prefix.
|
# TODO: this should not have a prefix.
|
||||||
# Specify the filename format for out files
|
# Specify the filename format for out files
|
||||||
PAPERLESS_FILENAME_FORMAT = os.getenv("PAPERLESS_FILENAME_FORMAT")
|
PAPERLESS_FILENAME_FORMAT = os.getenv("PAPERLESS_FILENAME_FORMAT")
|
||||||
|
|
||||||
CHANNEL_LAYERS = {
|
|
||||||
"default": {
|
|
||||||
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
|
||||||
"CONFIG": {
|
|
||||||
"hosts": [("broker", 6379)],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
@ -90,7 +90,7 @@ class RasterisedDocumentParser(DocumentParser):
|
|||||||
self._text = get_text_from_pdf(self.document_path)
|
self._text = get_text_from_pdf(self.document_path)
|
||||||
return self._text
|
return self._text
|
||||||
|
|
||||||
self.progress_callback(0,1,"Making greyscale images.")
|
self.progress_callback(0, 1, "Making greyscale images.")
|
||||||
images = self._get_greyscale()
|
images = self._get_greyscale()
|
||||||
|
|
||||||
if not images:
|
if not images:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user