Commits

zuroc committed 25ee76a

f

Comments (0)

Files changed (1)

 REDIS_FOLLOW_LIST = "FollowList:%s"
 
 def follow_new(from_id, to_id):
-    redis.lpush(REDIS_FOLLOW_LIST%from_id, to_id)
-    redis.sadd(REDIS_FOLLOW%from_id, to_id) 
+    p = redis.pipeline()
+    p.lpush(REDIS_FOLLOW_LIST%from_id, to_id)
+    p.sadd(REDIS_FOLLOW%from_id, to_id) 
+    p.execute()
 
 def follow_rm(from_id, to_id):
     redis.lrem(REDIS_FOLLOW_LIST%from_id, 0, to_id)