diff --git a/.ebextensions/cronjob.config b/.ebextensions/cronjob.config index 8965d7d5e8..89fcfdecaf 100644 --- a/.ebextensions/cronjob.config +++ b/.ebextensions/cronjob.config @@ -106,9 +106,10 @@ files: # 0 08 * * 1 root run-webapp-job i18n:transifex_load # - # Delete old alert content + # Clean ups # 0 1 * * 7 root run-webapp-job alerts:delete_alert_content + 15 5 * * * root run-as-webapp bin/rails r Rails.cache.cleanup # # Send Good Job queue metrics to AWS Cloudwatch # diff --git a/app/services/aggregate_school_service.rb b/app/services/aggregate_school_service.rb index 00af4fa9d4..0d2922e13c 100644 --- a/app/services/aggregate_school_service.rb +++ b/app/services/aggregate_school_service.rb @@ -6,7 +6,7 @@ def initialize(active_record_school) end def aggregate_school - Rails.cache.fetch(cache_key) do + Rails.cache.fetch(cache_key, expires_in: 3.days) do meter_collection = Amr::AnalyticsMeterCollectionFactory.new(@active_record_school).validated AggregateDataService.new(meter_collection).aggregate_heat_and_electricity_meters