FIX: Only cache reports with exceptions for 1 minute (#11447)

This commit is contained in:
Mark VanLandingham
2020-12-09 10:54:41 -06:00
committed by GitHub
parent 06077856ce
commit 521934f163
4 changed files with 32 additions and 4 deletions

View File

@ -223,7 +223,8 @@ class Report
Discourse.cache.read(cache_key(report))
end
def self.cache(report, duration)
def self.cache(report)
duration = report.error == :exception ? 1.minute : 35.minutes
Discourse.cache.write(cache_key(report), report.as_json, expires_in: duration)
end