diff --git a/app/controllers/admin/dashboard_next_controller.rb b/app/controllers/admin/dashboard_next_controller.rb index 7e6260cbf8f..908a4206d45 100644 --- a/app/controllers/admin/dashboard_next_controller.rb +++ b/app/controllers/admin/dashboard_next_controller.rb @@ -2,7 +2,7 @@ require 'disk_space' class Admin::DashboardNextController < Admin::AdminController def index - dashboard_data = AdminDashboardNextData.fetch_stats + dashboard_data = AdminDashboardNextData.fetch_cached_stats dashboard_data[:disk_space] = DiskSpace.cached_stats render json: dashboard_data end diff --git a/app/jobs/scheduled/dashboard_stats.rb b/app/jobs/scheduled/dashboard_stats.rb index 9556bd7ea1a..7e5fe8c4233 100644 --- a/app/jobs/scheduled/dashboard_stats.rb +++ b/app/jobs/scheduled/dashboard_stats.rb @@ -14,7 +14,9 @@ module Jobs GroupMessage.create(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i) end + # TODO: decide if we want to keep caching this every 30 minutes AdminDashboardData.refresh_stats + AdminDashboardNextData.refresh_stats end end end