NHSDigital / ndr_error

Error logging Rails engine
MIT License
1 stars 3 forks source link

Crash on vague search #10

Closed joshpencheon closed 5 years ago

joshpencheon commented 8 years ago

If there are more than 1000 search matches, the process crashes on Oracle.

Offending code (finder.rb):

# Add to that fingerprints with log records that matched the search:
log_print_ids = Log.filter_by_keywords(keywords).pluck(:error_fingerprintid)
records.concat scope.find(log_print_ids)
joshpencheon commented 5 years ago

find_in_batches has a default batch size of 1000, and would be ideal here.