django-celery url提供的数据存储在哪里?数据可用多长时间?内存消耗是多少? [英] Where is the data provided by django-celery urls stored? How long is the data available? And what is the memory consumption?

查看:246
本文介绍了django-celery url提供的数据存储在哪里?数据可用多长时间?内存消耗是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用django芹菜开始一个项目,我正在对'djcelery.urls'提供的任务URL进行ajax调用。

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. 该信息存储在哪里?是从django项目数据库中的djcelery表中调用还是保存在RabbitMQ服务器上?我对数据库中的djcelery表的理解是它们仅用于使用相机监视使用情况。

  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.

如果它存储在RabbitMQ服务器上,任务状态报告可以使用多长时间?这个数据消耗多少内存?

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?

我需要定期刷新任务状态报告以防止内存泄漏吗?这将如何做?通过重新启动rabbitmq服务器?

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?

谢谢。

推荐答案

结果存储在 CELERY_RESULT_BACKEND ,默认情况下禁用。

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

您可以通过创建一个新的 celery.result.AsyncResult 及相应的 task_id 如果我的ID是指向的,我如何获得任务的结果?

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?.

除非您设置 CELERY_AMQP_TASK_RESULT_EXPIRES ,任务永远不会过期。您可以使用 AsyncResult.forget()

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

这篇关于django-celery url提供的数据存储在哪里?数据可用多长时间?内存消耗是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆