Skip to content

A platform for community discussion. Free, open, simple.

PERF: Stop clearing report cache from browser pageview rollup job (#40334)

David Taylord22daa332614
diff --git a/app/jobs/scheduled/aggregate_browser_pageview_daily_rollups.rb b/app/jobs/scheduled/aggregate_browser_pageview_daily_rollups.rb
index cc34d0bd759..664ac0af376 100644
--- a/app/jobs/scheduled/aggregate_browser_pageview_daily_rollups.rb
+++ b/app/jobs/scheduled/aggregate_browser_pageview_daily_rollups.rb
@@ -16,9 +16,6 @@ module Jobs
BrowserPageviewCountryDailyRollup.aggregate(start_date: start_date, end_date: end_date)
BrowserPageviewReferrerDailyRollup.aggregate(start_date: start_date, end_date: end_date)
end
-
- Report.clear_cache("top_countries_by_browser_pageviews")
- Report.clear_cache("top_referrers_by_browser_pageviews")
end
private
diff --git a/spec/jobs/aggregate_browser_pageview_daily_rollups_spec.rb b/spec/jobs/aggregate_browser_pageview_daily_rollups_spec.rb
index edbc9cbd967..481cb6b6a8c 100644
--- a/spec/jobs/aggregate_browser_pageview_daily_rollups_spec.rb
+++ b/spec/jobs/aggregate_browser_pageview_daily_rollups_spec.rb
@@ -34,15 +34,6 @@ RSpec.describe Jobs::AggregateBrowserPageviewDailyRollups do
expect(BrowserPageviewCountryDailyRollup.pluck(:country_code)).to contain_exactly("US", "GB")
end
- it "clears the report cache after running so stale empty results do not linger" do
- SiteSetting.persist_browser_pageview_events = true
- Fabricate(:browser_pageview_event, country_code: "US")
- Report.expects(:clear_cache).with("top_countries_by_browser_pageviews").once
- Report.expects(:clear_cache).with("top_referrers_by_browser_pageviews").once
-
- described_class.new.execute({})
- end
-
it "only aggregates yesterday and today once historical rollups are populated" do
SiteSetting.persist_browser_pageview_events = true
Fabricate(:browser_pageview_event, country_code: "US", created_at: 60.days.ago)