2024-06-25 23:52:30 发布
网友
我有一个芹菜链,它有多个任务,其中一个任务是提取tar文件并返回tar文件中的JSON。在链完成时,pylibmc引发{},这意味着与该任务键相关联的memcached值大于1MB。在
pylibmc
这个错误不会影响数据链的数据完整性,但是我真的不想把这个数据写到缓存中,因为它永远不会再被使用。在
我查看了Celery文档,但没有发现任何有助于禁用特定任务缓存的内容。如有任何帮助,将不胜感激。在
您可以使用CELERY_IGNORE_RESULT或Task.ignore_result不存储结果。值仍然返回到链中的函数,它们只是不被持久化到缓存中。下面是一个使用ignore_result的示例
CELERY_IGNORE_RESULT
Task.ignore_result
ignore_result
@task(ignore_result=True) def your_task(): # your code here
文档:http://docs.celeryproject.org/en/latest/reference/celery.app.task.html#celery.app.task.Task.ignore_result
给我指出正确方向的博客文章:https://www.caktusgroup.com/blog/2014/09/29/celery-production/
您可以使用
CELERY_IGNORE_RESULT
或Task.ignore_result
不存储结果。值仍然返回到链中的函数,它们只是不被持久化到缓存中。下面是一个使用ignore_result
的示例文档:http://docs.celeryproject.org/en/latest/reference/celery.app.task.html#celery.app.task.Task.ignore_result
给我指出正确方向的博客文章:https://www.caktusgroup.com/blog/2014/09/29/celery-production/
相关问题 更多 >
编程相关推荐