def _RC_Run(key, port, action):
Tpyes = dict(hash="RC.hgetall(key)", list="RC.lrange(key,0,-1)", string="RC.get(key)",
zset="RC.zrange(key,0,-1,withscores=True)", set="RC.smembers(key)")
if port == 6379:
app = Flask(__name__)
app.config.from_pyfile('../conf/redis.conf')
nodes = app.config.get('NODES_PRODUCE')
RC = RedisCluster(startup_nodes=nodes, decode_responses=True)
else:
RC = redis.StrictRedis(host='redis.service.baihe', port=port)
T = RC.type(key)
if T == 'none':
flash('????:{0}'.format(T))
else:
if action == 'clear':
RC.delete(key)
flash('????????!')
return eval(Tpyes.get(T))
评论列表
文章目录