Implemented
9
Allow configuration of the date parsing regex timeout
Source: paperless-ngx/paperless-ngx#13654 · opened by @joe-tofu
Description Since v3, date detection no longer finds a date in documents whose extracted text exceeds roughly 11,500 characters (measured on a slow CPU, see below). Affected documents silently fall back to the import date as created. There is no user-visible error — only a WARNING in the server log. This is a regression introduced by putting the date search under the shared regex timeout: v2.20.15 — src/documents/parsers.py, standard re module, no timeout is possible: v3.0.5 — src/documents/plugins/date_parsing/regex_parser.py, regex module with a timeout: src/documents/regex.py: Two problems follow from this: 1. The limit is too tight for long documents. DATE_REGEX is a large alternation; matching it costs roughly 8.7 µs per character on the hardware below. Anything past ~11,500 characters exceeds 100 ms and is aborted. 2. The limit cannot be raised. MATCH_REGEX_TIMEOUT_SECONDS is read via getattr, but no such setting is defined anywhere in src/paperless/settings/, so it…
No pledges yet. Be the first to back this.
Comments
Similar requests
[Feature Request] Date created should be optional and approximate
2 votes · 0 comments
Remove 256-character limit on document matching criteria
2 votes · 0 comments
[Feature Request] Support relative date fields for workflow automation and conditional views (e.g. 'today')
21 votes · 0 comments
[Feature Request] expose django-allauth `SOCIALACCOUNT_REQUESTS_TIMEOUT` as a Paperless env var
2 votes · 0 comments
[Feature Request] Advanced search for custom fields with support for date filtering literals
7 votes · 0 comments
No comments yet.