Hello,
I have an issue with my celery.
this is my celery configuration.
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'prune.settings')
app = Celery('prune')
app.config_from_object('django.conf.settings', namespace='CELERY')
app.autodiscover_tasks()
this is my celery task
@shared_task
def delete_delivery_instance(instance_id):
try:
instance = DeliveryBoyLocation.objects.get(id =instance_id)
instance.delete()
return True
except Exception as e:
print(e,"delete_delivery_instance_error")
return False
and this is for sending tasks to celery, run in 5 min.
delete_delivery_instance.apply_async(args=[deliverylocation.id], countdown=300)
using this command to run celery in my linux services
celery -A prune worker --loglevel=info --pool=threads -c 4
I tried so many run celery commands but still faced issues.
the issue is that I sending 10 tasks to the celery but celery has received only 3-4 task
sometimes it takes 6-7 but celery does not take each task.
is there any configuration or setting that I miss to implement please guide me.
I’m using rabbitmq server as a message queue