Skip to content

Commit 5822e60

Browse files
committed
Add a time limit to how long it takes to fetch article results in Bento search (9 seconds)
1 parent 696ef10 commit 5822e60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controllers/bento_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ def index
1313
redirect_to_desired_controller
1414
initialize_search_data
1515
long_running_thread = Thread.new { article_results }
16+
long_running_thread.run
1617
solr_results
17-
long_running_thread.join
18+
long_running_thread.join 9
1819
redirect_to_most_useful_controller
1920
end
2021
end
@@ -34,6 +35,7 @@ def article_results
3435
@articles = results.records&.map { |record| Article.new record }
3536
rescue
3637
@num_article_hits = 0
38+
@articles = []
3739
end
3840

3941
def solr_results

0 commit comments

Comments
 (0)