PERF: use cached reports for dashboard if available
This commit is contained in:
parent
5f54b005a1
commit
bc9e0d46af
|
@ -2,7 +2,7 @@ require 'disk_space'
|
||||||
|
|
||||||
class Admin::DashboardNextController < Admin::AdminController
|
class Admin::DashboardNextController < Admin::AdminController
|
||||||
def index
|
def index
|
||||||
dashboard_data = AdminDashboardNextData.fetch_stats
|
dashboard_data = AdminDashboardNextData.fetch_cached_stats
|
||||||
dashboard_data[:disk_space] = DiskSpace.cached_stats
|
dashboard_data[:disk_space] = DiskSpace.cached_stats
|
||||||
render json: dashboard_data
|
render json: dashboard_data
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,9 @@ module Jobs
|
||||||
GroupMessage.create(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i)
|
GroupMessage.create(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: decide if we want to keep caching this every 30 minutes
|
||||||
AdminDashboardData.refresh_stats
|
AdminDashboardData.refresh_stats
|
||||||
|
AdminDashboardNextData.refresh_stats
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue