Comment Votes: update CommentSortsCache *after* updating comment scores.

This was causing CSC to have scores based on stale (off-by-one) vote
data.

One thousand thanks to @raldi for noticing this.
This commit is contained in:
Neil Williams
2013-02-22 11:49:33 -08:00
parent 4b08a17d09
commit bd522e5af7

View File

@@ -1507,10 +1507,6 @@ def process_votes(qname, limit=0):
votee = Thing._by_fullname(tid, data = True)
timer.intermediate("preamble")
if isinstance(votee, Comment):
update_comment_votes([votee])
timer.intermediate("update_comment_votes")
# I don't know how, but somebody is sneaking in votes
# for subreddits
if isinstance(votee, (Link, Comment)):
@@ -1518,6 +1514,10 @@ def process_votes(qname, limit=0):
handle_vote(voter, votee, dir, ip, organic,
cheater = cheater, foreground=True, timer=timer)
if isinstance(votee, Comment):
update_comment_votes([votee])
timer.intermediate("update_comment_votes")
timer.flush()
amqp.consume_items(qname, _handle_vote, verbose = False)