python rabbitMQ flush_output错误
程序:
while(1):
# query tasks from local file
if task:
publish(video_id)
else:
sleep(1)
长时间运行后,会报出以下错误,这是啥意思?
Traceback (most recent call last):
File "publisher_dev.py", line 209, in <module>
publish(video_id)
File "publisher_dev.py", line 157, in publish
delivery_mode=2, # make message persistent
File "/home/weike/.local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 1978, in basic_publish
mandatory, immediate)
File "/home/weike/.local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 2065, in publish
self._flush_output()
File "/home/weike/.local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 1174, in _flush_output
*waiters)
File "/home/weike/.local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 395, in _flush_output
raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
client和server之间的connection超时关闭了,需要用connection.sleep(),而不是time.sleep()