Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache less meter collections #4116

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ebextensions/cronjob.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion app/services/aggregate_school_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading