Where is the data provided by django-celery urls stored? How long is the data available? And what is the memory consumption?

跟風遠走 提交于 2019-12-06 16:04:46

问题


I am starting a project using django celery and I am making ajax calls to the task urls provided by 'djcelery.urls'.

I would like to know a few things about this data:

  1. Where is that information being stored? Is it called from the djcelery tables in my django projects database or is it kept on the RabbitMQ server? My understanding of the djcelery tables in my database is that they are only for monitoring the usage using the camera.

  2. If it is being stored on the RabbitMQ server, how long will the tasks status report be available? How much memory does this data consume?

  3. Do I need to flush the task status reports periodically to prevent a memory leak? How would this be done? By restarting the rabbitmq server?

Thanks.


回答1:


The results are stored in the CELERY_RESULT_BACKEND, which is disabled by default.

You can get the result of a task by creating a new celery.result.AsyncResult with the appropriate task_id: How do I get the result of a task if I have the ID that points there?.

Unless you set CELERY_AMQP_TASK_RESULT_EXPIRES, tasks will never expire. You can manually remove the result of a task using AsyncResult.forget().



来源:https://stackoverflow.com/questions/6987453/where-is-the-data-provided-by-django-celery-urls-stored-how-long-is-the-data-av

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!