pika - python rabbitMQ flush_output错误
黄舟
黄舟 2017-04-18 09:45:56
0
1
556

程序:

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
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

全部回复(1)
左手右手慢动作

client和server之间的connection超时关闭了,需要用connection.sleep(),而不是time.sleep()

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!