parent
7042237218
commit
1f510d0b40
2 changed files with 6 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# 0.7.16.0
|
||||
|
||||
## Refactor
|
||||
* Cache local posts/comments count for statistics [#8241](https://github.com/diaspora/diaspora/pull/8241)
|
||||
|
||||
## Bug fixes
|
||||
|
||||
|
|
|
|||
|
|
@ -114,8 +114,10 @@ class NodeInfoPresenter
|
|||
end
|
||||
|
||||
def local_comments
|
||||
@local_comments ||= Comment.joins(:author)
|
||||
.where.not(people: {owner_id: nil})
|
||||
.count
|
||||
Rails.cache.fetch("NodeInfoPresenter/local_comments", expires_in: 1.hour) do
|
||||
@local_comments ||= Comment.joins(:author)
|
||||
.where.not(people: {owner_id: nil})
|
||||
.count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue