Commit Graph
52 Commits
Author SHA1 Message Date
jonaswinkler 60ac1ddbb9 fix warnings about unclosed files. 2020-11-27 13:19:58 +01:00
jonaswinkler 20c1139632 inotify: cleanup descriptor when done 2020-11-27 13:12:34 +01:00
jonaswinkler d04b54140c moved consumption dir check into the correct spot 2020-11-27 13:12:13 +01:00
jonaswinkler d5ec762954 couple changes to the consumer. 2020-11-26 18:55:05 +01:00
jonaswinkler 75390693b9 Apparently there was a very good reason to use inotify. fixes #46 complete with test cases for inotify and polling. 2020-11-26 17:57:03 +01:00
Jonas Winkler d8e27600be workaround for a bug in django-q: task results with too long names would not show up in the result lists. 2020-11-22 13:53:19 +01:00
Jonas Winkler b44f8383e4 code cleanup 2020-11-21 14:03:45 +01:00
Jonas Winkler 2e97672b30 removed unused code. 2020-11-18 00:54:51 +01:00
Jonas Winkler fef6dd38f9 Merge branch 'dev' into mail_rework 2020-11-17 00:23:10 +01:00
Jonas Winkler 70d8e8bc56 added more testing 2020-11-16 23:16:37 +01:00
Jonas Winkler 31c4167535 added option for polling 2020-11-16 18:52:13 +01:00
Jonas Winkler 8dca459573 first version of the new consumer. 2020-11-16 18:26:54 +01:00
Jonas Winkler 0b1637da62 first implementation of the mail rework 2020-11-15 23:56:22 +01:00
Jonas Winkler 2e04ba1c04 code style fixes 2020-11-12 21:09:45 +01:00
Jonas Winkler 09651e0011 on_modified not needed for the consumer. 2020-11-12 10:41:47 +01:00
Jonas Winkler 917ee62f81 fixes #30 2020-11-12 09:30:04 +01:00
Jonas Winkler 9f29dc2863 updated consumer: now using watchdog 2020-11-01 23:07:54 +01:00
Jonas Winkler c596fe6782 unified data folders 2020-10-26 00:35:24 +01:00
Johann Bauer 22c7f309a7 Warn if consume directory contains subdirectories
.
2020-01-04 01:09:54 +01:00
Daniel Quinn cccc9e1a24 Clean up some linter complaints 2018-09-02 20:33:49 +01:00
Daniel Quinn 81a8cb45d7 It's exist_ok=, not exists_ok= -- my bad. 2018-05-28 13:08:00 +01:00
Erik Arvstedt bccac5017c fixup: remove helper fn 'make_dirs' 2018-05-21 00:45:00 +02:00
Erik Arvstedt 7e1d59377a Add inotify support 2018-05-11 14:14:50 +02:00
Erik Arvstedt 7357471b9e Consumer loop: make sleep duration dynamic
Make the sleep duration dynamic to account for the time spent in
loop_step.
This improves responsiveness when repeatedly consuming newly
arriving docs.

Use float epoch seconds (time.time()) as the time type for
MailFetcher.last_checked to allow for natural time arithmetic.
2018-05-11 14:14:50 +02:00
Erik Arvstedt bd75a65866 Refactor: renamings, extract fn 'loop'
Renamings:
loop -> loop_step
delta -> next_mail_time (this variable names a point in time, not a duration)

Extracting the 'loop' fn is a preparation for later commits where a
second type of loop is added.
2018-05-11 14:14:25 +02:00
Erik Arvstedt 61cd050e24 Ensure docs have been unmodified for some time before consuming
Previously, the second mtime check for new files usually happened right
after the first one, which could have caused consumption of docs that
were still being modified.

We're now waiting for at least FILES_MIN_UNMODIFIED_DURATION (0.5s).

This also cleans up the logic by eliminating the consumer.stats attribute
and the weird double call to consumer.run().

Additionally, this a fixes memory leak in consumer.stats where paths could be
added but never removed if the corresponding files disappeared from
the consumer dir before being considered ready.
2018-05-11 14:05:29 +02:00
Erik Arvstedt 873c98dddb Refactor: extract fn 'make_dirs' 2018-05-11 14:04:36 +02:00
Daniel Quinn d0252e8e44 Run a --oneshot loop twice
This was necessary since the first loop only ever collects file
statistics so that the second run can be sure about "readiness".
2018-03-03 18:43:20 +00:00
OvvandDaniel Quinn f56dafe7d9 Help & documentation 2018-03-03 18:43:20 +00:00
OvvandDaniel Quinn 8fefafb844 style & test 2018-03-03 18:43:20 +00:00
OvvandDaniel Quinn d1a57b5d68 Configuration cli argument for document_consumer 2018-03-03 18:43:20 +00:00
David Martin 3153bbd6a8 Fetch emails right at startup instead of waiting for 10 minutes.
Especially when first setting up the configuration for consuming
documents from emails it makes sense to quickly test the changes. Having
to wait for 10 minutes is not acceptable.

There are two ways around it that come to my mind: the simple approach
is to always fetch the emails when Paperless first starts. This way the
fetching of emails can be tested straight away.
The alternative would be to have a configuration option that allows to
set the interval in which emails are checked. The user could then reduce
it to test the setup and increase it again later on. This seems
needlessly complicated though, so fetching at startup it is.
2017-05-21 14:23:46 +10:00
Daniel Quinn 23bd887f16 Consumer loop time is now configurable 2017-01-01 18:41:06 +00:00
Daniel Quinn 30be13ae33 Added system checks to warn people of misconfigurations 2017-01-01 18:39:34 +00:00
Daniel Quinn 8e58406881 pep8 corrections 2016-10-26 09:32:59 +00:00
Daniel Quinn b92e007e15 Removed log components and introduced signals for tags & correspondents 2016-03-28 11:11:15 +01:00
Daniel Quinn 3b278c3a24 Added an informational log message for consumer start 2016-03-06 17:26:07 +00:00
Daniel Quinn 631aa99d92 No need to pass verbosity around anymore 2016-02-28 00:39:40 +00:00
Daniel Quinn 7843ea5037 Added and implemented a rudimentary logger 2016-02-14 16:09:52 +00:00
Daniel Quinn 3b5d4cdd39 Added some error handling 2016-02-14 01:32:25 +00:00
Daniel Quinn 7aadab23cc Added the Renderable mixin because DRY 2016-02-11 22:05:38 +00:00
Daniel Quinn 48761911b3 Image imports and consumption by mail work 2016-02-06 17:05:36 +00:00
Daniel Quinn 71075a691a The mailconsumer isn't a consumer at all. Best fixt that 2016-02-05 20:15:08 +00:00
Daniel Quinn a70b40f618 Broke the consumer script into separate files and started on a mail consumer 2016-01-30 01:18:52 +00:00
Daniel Quinn ace9389e5f #12: Support image documents 2016-01-29 23:18:03 +00:00
Daniel Quinn 0ec63ae1f9 #11: automatic tagging support 2016-01-28 07:23:11 +00:00
Daniel Quinn 65074b4375 Smarter check positions 2016-01-23 03:42:39 +00:00
Daniel Quinn 9e596953a3 pep8 2016-01-23 02:58:03 +00:00
Daniel Quinn fdb29f739f Added language detection 2016-01-23 02:33:29 +00:00
Daniel Quinn ec70d05517 Introducing language detection 2016-01-21 12:50:22 -05:00