Dual-write last modified timestamp for comments pages.

This commit is contained in:
Neil Williams
2012-05-25 10:43:39 -07:00
parent 66d0d4f627
commit fa1a065249
2 changed files with 4 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ from r2.lib.pages import FlairList, FlairCsv, FlairTemplateEditor, \
FlairSelector
from r2.lib.utils.trial_utils import indict, end_trial, trial_info
from r2.lib.pages.things import wrap_links, default_thing_wrapper
from r2.models.last_modified import LastModified
from r2.lib.menus import CommentSortMenu
from r2.lib.captcha import get_iden
@@ -920,6 +921,7 @@ class ApiController(RedditController):
if kind == 'link':
set_last_modified(item, 'comments')
LastModified.touch(item._fullname, 'Comments')
wrapper = default_thing_wrapper(expand_children = True)
jquery(".content").replace_things(item, True, True, wrap = wrapper)

View File

@@ -13,6 +13,7 @@ from r2.models.query_cache import (cached_query, merged_cached_query,
MergedCachedQuery)
from r2.models.query_cache import UserQueryCache, SubredditQueryCache
from r2.models.query_cache import ThingTupleComparator
from r2.models.last_modified import LastModified
import cPickle as pickle
@@ -1114,6 +1115,7 @@ def add_comment_tree(comments):
data = True, return_dict = False)
for link in links:
set_last_modified(link, 'comments')
LastModified.touch(link._fullname, 'Comments')
# amqp queue processing functions