forked from saurabh/orbit4-5
added expire time to cache.
This commit is contained in:
parent
27222ab6cd
commit
6d06790159
|
@ -332,7 +332,7 @@ class PagesController < ApplicationController
|
|||
if @editmode
|
||||
partials << "<div class='editmode-ps' title='#{subpart.module}'> " + render_widget_for_frontend(subpart.module,subpart.widget_method,subpart.widget_type,subpart.id.to_s) + "<a href='/page_parts/edit_sub_part?page_id=#{page.id.to_s}&part_id=#{part.id.to_s}&sub_part_id=#{subpart.id.to_s}#{(!$mobile.blank? ? '&mobile_view=1' : '')}'> </a></div>"
|
||||
else
|
||||
widget_html = Rails.cache.fetch("subpart_#{subpart.module}_#{subpart.id.to_s}_"+I18n.locale.to_s) do
|
||||
widget_html = Rails.cache.fetch("subpart_#{subpart.module}_#{subpart.id.to_s}_"+I18n.locale.to_s,{ race_condition_ttl: 2, expires_in: 5.minutes}) do
|
||||
render_widget_for_frontend(subpart.module,subpart.widget_method,subpart.widget_type,subpart.id.to_s)
|
||||
end
|
||||
partials << widget_html
|
||||
|
|
|
@ -31,7 +31,6 @@ module OrbitApp
|
|||
end
|
||||
@models_for_caching[:tag] = "Tag"
|
||||
@models_for_caching[:category] = "Category"
|
||||
puts @models_for_caching.to_s
|
||||
return @models_for_caching
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue