File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,23 +160,4 @@ def programme_types_per_session_id_and_year_group
160160 hash [ session_id ] [ year_group ] << programme_type
161161 end
162162 end
163-
164- # We preload this association separately because including it in the nested
165- # `patient_locations` preload (see includes above) caused the updater process
166- # to be killed, even with very small batches. The likely cause is memory pressure
167- # from eager loading a deeply nested association graph.
168- #
169- # Preloading it here for the distinct `Location` records in each batch keeps
170- # `StatusGenerator::Programme` query-free without incurring the cost of the
171- # larger nested preload.
172- def preload_location_programme_year_groups ( batch )
173- locations = batch . flat_map ( &:patient_locations ) . map ( &:location ) . uniq
174-
175- ActiveRecord ::Associations ::Preloader . new (
176- records : locations ,
177- associations : {
178- location_programme_year_groups : :location_year_group
179- }
180- ) . call
181- end
182163end
You can’t perform that action at this time.
0 commit comments