Closed namvnngu closed 3 years ago
Hey @nnfunny - Great job with integrating Celery and Redis into the project, however I noticed that you didn't update the sample environment files to accomodate for new environment variables. In addition I feel as if the Redis health-check URL could be a bit more specific, such as redis-healthcheck. Happy to hear your thoughts on URL health check URL.
Hi @notkurt, I updated the environment variables and the health-check URL according to your good suggestions. If you need to test Celery, I can suggest you one article I read Setting up an asynchronous task queue for Django using Celery and Redis. I'd love to hear feedback from you. Cheers.
Premature merge, however everything is all good on your end. @nnfunny - Tested with no issues. Great job!
Files changed:
docker-compose.yml
: Add Redis servicerequirement.txt
: Add two Python dependencies,celery==5.0.5
anddjango-redis==4.12.1
/api/__init__.py
: Instantiate the Celery app every time Django application is started/api/settings.py
: Configure variables for Redis and Celery when working with the Django application/endpoint/urls.py
: Add pathup
to test Redis connection/endpoint/views.py
: Define functionup
to test Redis connectionFiles created:
/api/celery.py
: Define the Celery application for instantiation/endpoint/tasks.py
: Define the first Celery task to testPlease comment feedback below for further improvements.
Ref issue #1