Permalink
Browse files

close #388, expires storage cache key in 5 minutes.

  • Loading branch information...
1 parent 5e53ac8 commit e24b1a9dc86387c4b6ec93626d6511e800e71047 @saberma saberma committed Feb 2, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 app/models/shop.rb
  2. +4 −4 app/views/admin/account/_about.html.haml
View
@@ -81,7 +81,7 @@ def plan_unlimited?
end
def storage # 已占用的容量(如要支持windows可修改为循环获取目录大小)
- Rails.cache.fetch(self.storage_cache_key) do
+ Rails.cache.fetch(self.storage_cache_key, expires_in: 5.minutes) do
`du -sm #{self.path} | awk '{print $1}'`.to_i # 以M为单位
end
end
@@ -12,10 +12,10 @@
%span.note{:style => ""}==剩余#{current_plan_type.skus - skus_size}
%tr#disk-management
%td.r 剩余使用空间:
- %td
- %div{:style => "width:170px"}
- .progress-container{:style => "margin-top:7px"}
- .progress-bar{:style => "width: #{storages_size*100/current_plan_type.storage}%; "}
+ %td(title="数值会被缓存5分钟")
+ %div(style="width:170px")
+ .progress-container(style="margin-top:7px")
+ .progress-bar(style="width: #{storages_size*100/current_plan_type.storage}%; ")
%span.note==剩余#{current_plan_type.storage - storages_size} MB
-#
%tr

0 comments on commit e24b1a9

Please sign in to comment.