commentstree_q: Make it possible to skip updates for specific threads.

This commit is contained in:
Neil Williams
2013-02-04 13:56:29 -08:00
parent 203d1e86ea
commit ad2e486e5d
2 changed files with 11 additions and 1 deletions

View File

@@ -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)

View File

@@ -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)