Skip to content

Commit 559b071

Browse files
committed
Remove unused method in PatientStatusUpdater
This method implementation and an invocation from `PatientStatusUpdater#update_programme_statuses!` was originally added in this commit [1] in #6468. Both the implementation and invocation were removed in this commit [2] in #6611. Then the implementation was then re-added without the corresponding invocation in this commit [3] within #6677 which was the "Version 8.1.0" pull request. Since the method is never invoked, it's safe to remove it. [1]: 25e876a [2]: 29460d4 [3]: c66b757
1 parent 8e92a0b commit 559b071

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

app/lib/patient_status_updater.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff 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
182163
end

0 commit comments

Comments
 (0)