This document provides an overview of the Celery configuration and tasks used in the Map Action project. Celery is used for distributed task processing, allowing for efficient handling of asynchronous operations.
The Celery application is configured in the celery_config.py
file. It uses Redis as both the message broker and backend for task queueing and result storage. The configuration retrieves Redis connection details from environment variables.
REDIS_HOST
, REDIS_PORT
, REDIS_USERNAME
, REDIS_PASSWORD
, and REDIS_URL
are used to configure the Redis connection.The Celery tasks are defined in the celery_task.py
file. These tasks perform various operations, including image prediction, fetching contextual information, and analyzing incident zones.
perform_prediction:
image
(bytes) - The image data to be processed.fetch_contextual_information:
prediction
(str), sensitive_structures
(list), zone
(str).analyze_incident_zone:
lat
(float), lon
(float), incident_location
(str), incident_type
(str), start_date
(str), end_date
(str).For more detailed information on each task, refer to the celery_task.py
file in the app/services/celery/
directory.