[Git][noosfero/noosfero][master] 2 commits: content_viewer: defer @page.hit
Bráulio Bhavamitra
gitlab at gitlab.com
Fri Oct 2 18:04:37 BRT 2015
Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero
Commits:
18dcc058 by Braulio Bhavamitra at 2015-09-26T01:30:47Z
content_viewer: defer @page.hit
- - - - -
bbfc6966 by Bráulio Bhavamitra at 2015-10-02T21:04:11Z
Merge branch 'defer-page-hit' into 'master'
content_viewer: defer @page.hit
yeah, now we have unicorn for that :)
See merge request !678
- - - - -
1 changed file:
- app/controllers/public/content_viewer_controller.rb
Changes:
=====================================
app/controllers/public/content_viewer_controller.rb
=====================================
--- a/app/controllers/public/content_viewer_controller.rb
+++ b/app/controllers/public/content_viewer_controller.rb
@@ -39,7 +39,10 @@ class ContentViewerController < ApplicationController
end
# At this point the page will be showed
- @page.hit unless user_is_a_bot? || already_visited?(@page)
+
+ unless user_is_a_bot? || already_visited?(@page)
+ Noosfero::Scheduler::Defer.later{ @page.hit }
+ end
@page = FilePresenter.for @page
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/47aff2704c062929fe1163b137cde4cea07dc1b9...bbfc69660c9899304cc5fb21f5b3dbc9d3e2cf18
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151002/cbd54661/attachment.html>
More information about the Noosfero-dev
mailing list