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了,导致图片显示不正常,坑!!