diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-03 14:37:36 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-14 15:20:55 +0200 |
commit | af8a3e3583247001ed41a74c0ca5032ea6fe18fd (patch) | |
tree | dff39970459d0050eb4fa3af3fcb1712b1925d60 | |
parent | cc677c8f8ce038610018e43fd41d238a3bf73ff3 (diff) | |
download | gitlab-ce-af8a3e3583247001ed41a74c0ca5032ea6fe18fd.tar.gz |
Cache user cohorts results for a day
-rw-r--r-- | app/controllers/admin/user_cohorts_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/admin/user_cohorts_controller.rb b/app/controllers/admin/user_cohorts_controller.rb index 5dd6eedfb06..1d9e3547807 100644 --- a/app/controllers/admin/user_cohorts_controller.rb +++ b/app/controllers/admin/user_cohorts_controller.rb @@ -1,7 +1,9 @@ class Admin::UserCohortsController < Admin::ApplicationController def index if ApplicationSetting.current.usage_ping_enabled - @cohorts = UserCohortsService.new.execute(12) + @cohorts = Rails.cache.fetch('user_cohorts', expires_in: 1.day) do + UserCohortsService.new.execute + end end end end |