From 33f8ef66084bbfb61bf0b4e0f53e1da5e7cc84dc Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 31 Jan 2012 23:33:05 +0000 Subject: Close xapian db before opening it again This *ought* to fix the problem with the alert-tracks daemon opening more and more copies of the xapian db till it exhausts the available file descriptors. --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1849f23f3..b681f455d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -363,7 +363,10 @@ class ApplicationController < ActionController::Base else @page = this_page end - return InfoRequest.full_search(models, @query, order, ascending, collapse, @per_page, @page) + result = InfoRequest.full_search(models, @query, order, ascending, collapse, @per_page, @page) + result.results # Touch the results to load them, otherwise accessing them from the view + # might fail later if the database has subsequently been reopened. + return result end def get_search_page_from_params return (params[:page] || "1").to_i -- cgit v1.2.3