Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
CommentPane: try to avoid building comment tree if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed Dec 7, 2012
1 parent d0babbd commit cf2d562
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions r2/r2/lib/pages/pages.py
Expand Up @@ -1168,11 +1168,11 @@ def renderer():
parent_name = article._fullname)
return listing.listing()

# generate the listing we would make for this user if caching is disabled.
my_listing = renderer()

# for now, disable the cache if the user happens to be an author of anything.
# disable the cache if the user is the author of anything in the
# thread because of edit buttons etc.
my_listing = None
if try_cache and c.user_is_loggedin:
my_listing = renderer()
for t in self.listing_iter(my_listing):
if getattr(t, "is_author", False):
try_cache = False
Expand Down Expand Up @@ -1239,6 +1239,7 @@ def renderer():
saves = saves).render()
g.log.debug("using comment page cache")
else:
my_listing = my_listing or renderer()
self.rendered = my_listing.render()

if try_cache:
Expand Down

0 comments on commit cf2d562

Please sign in to comment.