def run_commentstree(qname='commentstree_q', limit=400):
 @g.stats.amqp_processor(qname)
 def _run_commentstree(msgs, chan):
  comments = Comment._by_fullname([msg.body for msg in msgs], data=True, return_dict=False)
  print ('Processing %r' % (comments,))
  if comments:
   add_comments(comments)
 if (qname == 'commentstree_fastlane_q'):
  limit = max(1000, limit)
 amqp.handle_items(qname, _run_commentstree, limit=limit)

def run_commentstree ( qname = 'commentstree_q' , limit = 400 ) : @ g . stats . amqp_processor ( qname ) def _run_commentstree ( msgs , chan ) : comments = Comment . _by_fullname ( [ msg . body for msg in msgs ] , data = True , return_dict = False ) print ( 'Processing %r' % ( comments , ) ) if comments : add_comments ( comments ) if ( qname == 'commentstree_fastlane_q' ) : limit = max ( 1000 , limit ) amqp . handle_items ( qname , _run_commentstree , limit = limit )
add new incoming comments to their respective comments trees .