diff --git a/r2/r2/lib/db/queries.py b/r2/r2/lib/db/queries.py index ac3c49aac..f2b3866fe 100755 --- a/r2/r2/lib/db/queries.py +++ b/r2/r2/lib/db/queries.py @@ -1355,7 +1355,16 @@ def run_commentstree(qname="commentstree_q", limit=100): data = True, return_dict = False) print 'Processing %r' % (comments,) - add_comments(comments) + # when fastlaning a thread, we may need to have this qproc ignore + # messages that were put into the non-fastlane queue and are causing + # both to back up. a full recompute of the old thread will fix these + # missed messages. + links = Link._byID([com.link_id for com in comments], data=True) + comments = [com for com in comments + if links[com.link_id].skip_commentstree_q != qname] + + if comments: + add_comments(comments) amqp.handle_items(qname, _run_commentstree, limit = limit) diff --git a/r2/r2/models/link.py b/r2/r2/models/link.py index 9f467eb0a..9401975b2 100755 --- a/r2/r2/models/link.py +++ b/r2/r2/models/link.py @@ -74,6 +74,7 @@ class Link(Thing, Printable): comment_tree_version=1, comment_tree_id=0, contest_mode=False, + skip_commentstree_q="", ) _essentials = ('sr_id', 'author_id') _nsfw = re.compile(r"\bnsfw\b", re.I)