Skip to content

Commit

Permalink
Post doesn't checks key dups in the
Browse files Browse the repository at this point in the history
  • Loading branch information
sitnin committed Oct 24, 2010
1 parent a9e7a1b commit 16494d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def reduce(mapped_words, index, what="posts"):
sorted_word2count = sorted(word2count.items(), key=itemgetter(0))
for word, count in sorted_word2count:
key = "idx:%s:%s"%(word, what)
l = R.llen(key)
idx = R.lrange(key, 0, l-1)
if not index in idx:
R.rpush(key, index)
# l = R.llen(key)
# idx = R.lrange(key, 0, l-1)
# if not index in idx:
R.rpush(key, index)


class Posts(tornado.web.RequestHandler):
Expand Down

0 comments on commit 16494d2

Please sign in to comment.