python redis pipeline报ConnectionError

import redis

conn = redis.Redis(host='172.28.12.177',port=19230,db=0)
>>> conn.setnx('heheda', 0)
True
>>> pipe = conn.pipeline()
>>> pipe.expire('hehe', 60)
Pipeline<ConnectionPool<Connection<host=172.28.12.177,port=19230,db=0>>>
>>> pipe.incr('hehe')
Pipeline<ConnectionPool<Connection<host=172.28.12.177,port=19230,db=0>>>
>>> pipe.execute()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/client.py", line 2641, in execute
    return execute(conn, stack, raise_on_error)
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/client.py", line 2503, in _execute_transaction
    self.parse_response(connection, '_')
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/client.py", line 2584, in parse_response
    self, connection, command_name, **options)
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/client.py", line 585, in parse_response
    response = connection.read_response()
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/connection.py", line 577, in read_response
    response = self._parser.read_response()
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/connection.py", line 238, in read_response
    response = self._buffer.readline()
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/connection.py", line 168, in readline
    self._read_from_socket()
  File "/data/release/spp_mailgw-1.0/client/tools/lib/lib/python2.6/site-packages/redis/connection.py", line 143, in _read_from_socket
    (e.args,))

redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)


应该pipe = conn.pipeline(transaction=False), 该扩展不支持事务


在邮件中添加附件时,PHP的调用方把cid大写为CID了,导致图片显示不正常,坑!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值