django - [标签:芹菜 [连接重置错误,由于“与代理的连接”丢失或无法接收确认
问题描述
我有一个名为 task_conclude_key_issues_through_selenium 的后台任务,它将在网页上执行一些点击操作,大约需要 3 到 5 分钟。
一旦芹菜后台任务执行完成,我就会收到以下任何错误。
1.[2020-10-26 16:14:45,233:警告/MainProcess] 消费者:与代理的连接丢失。正在尝试重新建立连接... Traceback (last last call last) 2.Couldn't ack 2, reason:ConnectionResetError(10054, "An existing connection was强制关闭远程主机', None, 10054, None)
2 到 3 分钟后,它连接到代理并显示以下日志消息 ConnectionResetError: [WinError 10054] 远程主机强制关闭现有连接 [2020-10-26 16:23:07,677: INFO/MainProcess] Connected to amqp ://guest:**@127.0.0.1:5672//
views.py:
--------
board_details_task_info = task_conclude_key_issues_through_selenium.apply_async(args=[created_pk])
tasks.py:
--------
@shared_task(bind=True)
def task_conclude_key_issues_through_selenium(self, created_pk):
settings.py:
-----------
CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_RESULT_BACKEND = 'django-db'
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TRACK_STARTED=True
我的应用程序使用以下包: 1.celery - 5.0.1 2.celery_progress 3.Python - 3.6.2
请让我们知道如何解决这些错误并继续进行。
问候,N.Dilip kumar。
解决方案
此问题已通过升级 celery 和 django_celery_results 软件包的安装得到解决。安装了最新版本的 celery 和 django_celery_results。1.django_celery_results==1.2.1 2.Celery==4.4.7
推荐阅读
- php - Laravel 5.6 将日期时间保存到数据库
- c++ - 为什么 Stroustup 书中的 has_f 不起作用?
- javascript - 谷歌地图上每个geojson的多个信息窗口
- java - 如何避免 IntelliJ 重置语言级别?
- php - 如何查看数据库中是否已经存在随机数?
- dask - dask 集群不使用所有核心
- json - Angular Material 表仅按最后一列排序
- c# - 在.net 中不使用 Response.Redirect(url) 的情况下重定向到自定义页面?
- html - 无法在 Shiny App 中放置徽标/图像
- excel - 宏 - 将由复选框触发的同一行中的某些单元格复制到不同的工作表