mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
remove async queries
This commit is contained in:
parent
c7f8317084
commit
0dc99486f8
5 changed files with 5 additions and 8 deletions
|
|
@ -55,7 +55,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Precalculate response rates
|
- Precalculate response rates
|
||||||
- Add page caching
|
- Add page caching
|
||||||
- Add counter caches
|
- Add counter caches
|
||||||
- Add async queries
|
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ class OverviewController < SqmApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def measures
|
def measures
|
||||||
@measures ||= Measure.all.includes(%i[scales admin_data_items category]).load_async
|
@measures ||= Measure.all.includes(%i[scales admin_data_items category])
|
||||||
end
|
end
|
||||||
|
|
||||||
def subcategories
|
def subcategories
|
||||||
@subcategories ||= Subcategory.all.load_async
|
@subcategories ||= Subcategory.all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ class SqmApplicationController < ApplicationController
|
||||||
|
|
||||||
def set_schools_and_districts
|
def set_schools_and_districts
|
||||||
@district = District.find_by_slug district_slug
|
@district = District.find_by_slug district_slug
|
||||||
@districts = District.all.order(:name).load_async
|
@districts = District.all.order(:name)
|
||||||
@school = School.find_by_slug(school_slug)
|
@school = School.find_by_slug(school_slug)
|
||||||
@schools = School.includes([:district]).where(district: @district).order(:name).load_async
|
@schools = School.includes([:district]).where(district: @district).order(:name)
|
||||||
@academic_year = AcademicYear.find_by_range params[:year]
|
@academic_year = AcademicYear.find_by_range params[:year]
|
||||||
@academic_years = AcademicYear.all.order(range: :desc).load_async
|
@academic_years = AcademicYear.all.order(range: :desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def district_slug
|
def district_slug
|
||||||
|
|
|
||||||
|
|
@ -71,5 +71,4 @@ Rails.application.configure do
|
||||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||||
|
|
||||||
config.action_controller.include_all_helpers = false
|
config.action_controller.include_all_helpers = false
|
||||||
config.active_record.async_query_executor = :global_thread_pool
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -111,5 +111,4 @@ Rails.application.configure do
|
||||||
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
||||||
|
|
||||||
config.action_controller.include_all_helpers = false
|
config.action_controller.include_all_helpers = false
|
||||||
config.active_record.async_query_executor = :global_thread_pool
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue