mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Merge pull request #1648 from paperless-ngx/feature-use-celery
Feature: Transition to celery for background tasks
This commit is contained in:
		| @@ -112,7 +112,7 @@ To do the setup you need to perform the steps from the following chapters in a c | ||||
|  | ||||
|     .. code:: shell-session | ||||
|  | ||||
|         python3 manage.py runserver & python3 manage.py document_consumer & python3 manage.py qcluster | ||||
|         python3 manage.py runserver & python3 manage.py document_consumer & celery --app paperless worker | ||||
|  | ||||
| 11. Login with the superuser credentials provided in step 8 at ``http://localhost:8000`` to create a session that enables you to use the backend. | ||||
|  | ||||
| @@ -128,14 +128,14 @@ Configure the IDE to use the src/ folder as the base source folder. Configure th | ||||
| launch configurations in your IDE: | ||||
|  | ||||
| *   python3 manage.py runserver | ||||
| *   python3 manage.py qcluster | ||||
| *   celery --app paperless worker | ||||
| *   python3 manage.py document_consumer | ||||
|  | ||||
| To start them all: | ||||
|  | ||||
| .. code:: shell-session | ||||
|  | ||||
|     python3 manage.py runserver & python3 manage.py document_consumer & python3 manage.py qcluster | ||||
|     python3 manage.py runserver & python3 manage.py document_consumer & celery --app paperless worker | ||||
|  | ||||
| Testing and code style: | ||||
|  | ||||
|   | ||||
| @@ -39,7 +39,7 @@ Paperless consists of the following components: | ||||
|  | ||||
|     .. _setup-task_processor: | ||||
|  | ||||
| *   **The task processor:** Paperless relies on `Django Q <https://django-q.readthedocs.io/en/latest/>`_ | ||||
| *   **The task processor:** Paperless relies on `Celery - Distributed Task Queue <https://docs.celeryq.dev/en/stable/index.html>`_ | ||||
|     for doing most of the heavy lifting. This is a task queue that accepts tasks from | ||||
|     multiple sources and processes these in parallel. It also comes with a scheduler that executes | ||||
|     certain commands periodically. | ||||
| @@ -62,13 +62,6 @@ Paperless consists of the following components: | ||||
|     tasks fail and inspect the errors (i.e., wrong email credentials, errors during consuming a specific | ||||
|     file, etc). | ||||
|  | ||||
|     You may start the task processor by executing: | ||||
|  | ||||
|     .. code:: shell-session | ||||
|  | ||||
|         $ cd /path/to/paperless/src/ | ||||
|         $ python3 manage.py qcluster | ||||
|  | ||||
| *   A `redis <https://redis.io/>`_ message broker: This is a really lightweight service that is responsible | ||||
|     for getting the tasks from the webserver and the consumer to the task scheduler. These run in a different | ||||
|     process (maybe even on different machines!), and therefore, this is necessary. | ||||
| @@ -291,7 +284,20 @@ Build the Docker image yourself | ||||
|     .. code:: yaml | ||||
|  | ||||
|         webserver: | ||||
|             build: . | ||||
|             build: | ||||
|               context: . | ||||
|               args: | ||||
|                 QPDF_VERSION: x.y.x | ||||
|                 PIKEPDF_VERSION: x.y.z | ||||
|                 PSYCOPG2_VERSION: x.y.z | ||||
|                 JBIG2ENC_VERSION: 0.29 | ||||
|  | ||||
|     .. note:: | ||||
|  | ||||
|         You should match the build argument versions to the version for the release you have | ||||
|         checked out.  These are pre-built images with certain, more updated software. | ||||
|         If you want to build these images your self, that is possible, but beyond | ||||
|         the scope of these steps. | ||||
|  | ||||
| 4.  Follow steps 3 to 8 of :ref:`setup-docker_hub`. When asked to run | ||||
|     ``docker-compose pull`` to pull the image, do | ||||
| @@ -332,7 +338,7 @@ writing. Windows is not and will never be supported. | ||||
|  | ||||
|     .. code:: | ||||
|  | ||||
|         python3 python3-pip python3-dev imagemagick fonts-liberation gnupg libpq-dev libmagic-dev mime-support libzbar0 poppler-utils | ||||
|         python3 python3-pip python3-dev imagemagick fonts-liberation gnupg libpq-dev default-libmysqlclient-dev libmagic-dev mime-support libzbar0 poppler-utils | ||||
|  | ||||
|     These dependencies are required for OCRmyPDF, which is used for text recognition. | ||||
|  | ||||
| @@ -361,7 +367,7 @@ writing. Windows is not and will never be supported. | ||||
|     You will also need ``build-essential``, ``python3-setuptools`` and ``python3-wheel`` | ||||
|     for installing some of the python dependencies. | ||||
|  | ||||
| 2.  Install ``redis`` >= 5.0 and configure it to start automatically. | ||||
| 2.  Install ``redis`` >= 6.0 and configure it to start automatically. | ||||
|  | ||||
| 3.  Optional. Install ``postgresql`` and configure a database, user and password for paperless. If you do not wish | ||||
|     to use PostgreSQL, MariaDB and SQLite are available as well. | ||||
| @@ -461,8 +467,9 @@ writing. Windows is not and will never be supported. | ||||
|     as a starting point. | ||||
|  | ||||
|     Paperless needs the ``webserver`` script to run the webserver, the | ||||
|     ``consumer`` script to watch the input folder, and the ``scheduler`` | ||||
|     script to run tasks such as email checking and document consumption. | ||||
|     ``consumer`` script to watch the input folder, ``taskqueue`` for the background workers | ||||
|     used to handle things like document consumption and the ``scheduler`` script to run tasks such as | ||||
|     email checking at certain times . | ||||
|  | ||||
| 		The ``socket`` script enables ``gunicorn`` to run on port 80 without | ||||
| 		root privileges. For this you need to uncomment the ``Require=paperless-webserver.socket`` | ||||
|   | ||||
| @@ -19,7 +19,7 @@ Check for the following issues: | ||||
|  | ||||
|     .. code:: shell-session | ||||
|  | ||||
|         $ python3 manage.py qcluster | ||||
|         $ celery --app paperless worker | ||||
|  | ||||
| *   Look at the output of paperless and inspect it for any errors. | ||||
| *   Go to the admin interface, and check if there are failed tasks. If so, the | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon