添加返回条数控制
This commit is contained in:
parent
eed8a12043
commit
114e547013
@ -137,7 +137,11 @@ class DispatchHandler(tornado.web.RequestHandler):
|
|||||||
id_list = []
|
id_list = []
|
||||||
if limit < len(ids):
|
if limit < len(ids):
|
||||||
for i in range(limit):
|
for i in range(limit):
|
||||||
id_list.append(my_redis.srandmember(key))
|
while 1:
|
||||||
|
new = my_redis.srandmember(key)
|
||||||
|
if new not in id_list:
|
||||||
|
id_list.append(new)
|
||||||
|
break
|
||||||
for id in id_list:
|
for id in id_list:
|
||||||
temp = my_redis.hgetall(f"ad::{id}::info")
|
temp = my_redis.hgetall(f"ad::{id}::info")
|
||||||
info.append(temp)
|
info.append(temp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user