From 40d234110b81aa84ca57aa7bf1780a5b33c73bff Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 21 Aug 2012 18:46:38 -0700 Subject: [PATCH] vote_q: Remove unused process_votes_multi. --- r2/r2/lib/db/queries.py | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/r2/r2/lib/db/queries.py b/r2/r2/lib/db/queries.py index f144f0fb6..7019a5003 100755 --- a/r2/r2/lib/db/queries.py +++ b/r2/r2/lib/db/queries.py @@ -1374,7 +1374,7 @@ def handle_vote(user, thing, dir, ip, organic, cheater=False, foreground=False): LastModified.touch(user._fullname, timestamps) -def process_votes_single(qname, limit=0): +def process_votes(qname, limit=0): # limit is taken but ignored for backwards compatibility @g.stats.amqp_processor(qname) @@ -1397,41 +1397,6 @@ def process_votes_single(qname, limit=0): amqp.consume_items(qname, _handle_vote, verbose = False) -def process_votes_multi(qname, limit=100): - # limit is taken but ignored for backwards compatibility - @g.stats.amqp_processor(qname) - def _handle_vote(msgs, chan): - comments = [] - - for msg in msgs: - tag = msg.delivery_tag - r = pickle.loads(msg.body) - - uid, tid, dir, ip, organic, cheater = r - voter = Account._byID(uid, data=True) - votee = Thing._by_fullname(tid, data = True) - if isinstance(votee, Comment): - comments.append(votee) - - if not isinstance(votee, (Link, Comment)): - # I don't know how, but somebody is sneaking in votes - # for subreddits - continue - - print (voter, votee, dir, ip, organic, cheater) - try: - handle_vote(voter, votee, dir, ip, organic, - cheater=cheater, foreground=False) - except Exception, e: - print 'Rejecting %r:%r because of %r' % (msg.delivery_tag, r,e) - chan.basic_reject(msg.delivery_tag, requeue=True) - - update_comment_votes(comments) - - amqp.handle_items(qname, _handle_vote, limit = limit) - -process_votes = process_votes_single - try: from r2admin.lib.admin_queries import * except ImportError: