Commit 4c1538a9465304acc22502f12199d2e2b360cb81
1 parent
40f18681
Exists in
master
and in
4 other branches
Use redis as cache storage. cache events
Showing
4 changed files
with
33 additions
and
12 deletions
Show diff stats
Gemfile
Gemfile.lock
... | ... | @@ -329,8 +329,24 @@ GEM |
329 | 329 | json (~> 1.4) |
330 | 330 | redcarpet (2.2.2) |
331 | 331 | redis (3.0.2) |
332 | + redis-actionpack (3.2.3) | |
333 | + actionpack (~> 3.2.3) | |
334 | + redis-rack (~> 1.4.0) | |
335 | + redis-store (~> 1.1.0) | |
336 | + redis-activesupport (3.2.3) | |
337 | + activesupport (~> 3.2.3) | |
338 | + redis-store (~> 1.1.0) | |
332 | 339 | redis-namespace (1.2.1) |
333 | 340 | redis (~> 3.0.0) |
341 | + redis-rack (1.4.2) | |
342 | + rack (~> 1.4.1) | |
343 | + redis-store (~> 1.1.0) | |
344 | + redis-rails (3.2.3) | |
345 | + redis-actionpack (~> 3.2.3) | |
346 | + redis-activesupport (~> 3.2.3) | |
347 | + redis-store (~> 1.1.0) | |
348 | + redis-store (1.1.3) | |
349 | + redis (>= 2.2.0) | |
334 | 350 | request_store (1.0.5) |
335 | 351 | rspec (2.12.0) |
336 | 352 | rspec-core (~> 2.12.0) |
... | ... | @@ -504,6 +520,7 @@ DEPENDENCIES |
504 | 520 | rb-fsevent |
505 | 521 | rb-inotify |
506 | 522 | redcarpet (~> 2.2.2) |
523 | + redis-rails | |
507 | 524 | rspec-rails (= 2.12.2) |
508 | 525 | sass-rails (~> 3.2.5) |
509 | 526 | sdoc | ... | ... |
app/views/events/_event.html.haml
1 | 1 | - if event.proper? |
2 | - %div.event-item | |
3 | - %span.cgray.pull-right | |
4 | - #{time_ago_in_words(event.created_at)} ago. | |
2 | + = cache event do | |
3 | + %div.event-item | |
4 | + %span.cgray.pull-right | |
5 | + #{time_ago_in_words(event.created_at)} ago. | |
5 | 6 | |
6 | - = image_tag gravatar_icon(event.author_email), class: "avatar s24" | |
7 | + = image_tag gravatar_icon(event.author_email), class: "avatar s24" | |
7 | 8 | |
8 | - - if event.push? | |
9 | - = render "events/event/push", event: event | |
10 | - .clearfix | |
11 | - - elsif event.note? | |
12 | - = render "events/event/note", event: event | |
13 | - - else | |
14 | - = render "events/event/common", event: event | |
9 | + - if event.push? | |
10 | + = render "events/event/push", event: event | |
11 | + .clearfix | |
12 | + - elsif event.note? | |
13 | + = render "events/event/note", event: event | |
14 | + - else | |
15 | + = render "events/event/common", event: event | |
15 | 16 | ... | ... |
config/environments/production.rb
... | ... | @@ -40,7 +40,7 @@ Gitlab::Application.configure do |
40 | 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) |
41 | 41 | |
42 | 42 | # Use a different cache store in production |
43 | - config.cache_store = :memory_store | |
43 | + config.cache_store = :redis_store | |
44 | 44 | |
45 | 45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server |
46 | 46 | # config.action_controller.asset_host = "http://assets.example.com" | ... | ... |