From 573e9a13e8a1f853b9948f23a3b7c7dddff08532 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 25 Aug 2023 09:59:52 +0200 Subject: [PATCH] nominatim: add api timeout settings --- cookbooks/nominatim/attributes/default.rb | 2 ++ cookbooks/nominatim/recipes/default.rb | 4 +++- cookbooks/nominatim/templates/default/nominatim.env.erb | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cookbooks/nominatim/attributes/default.rb b/cookbooks/nominatim/attributes/default.rb index 1edb544d2..1f5a1560b 100644 --- a/cookbooks/nominatim/attributes/default.rb +++ b/cookbooks/nominatim/attributes/default.rb @@ -17,6 +17,8 @@ default[:nominatim][:qa_revision] = "main" default[:nominatim][:api_flavour] = "php" default[:nominatim][:api_workers] = 10 default[:nominatim][:api_pool_size] = 10 +default[:nominatim][:api_query_timeout] = 5 +default[:nominatim][:api_request_timeout] = 20 default[:nominatim][:fpm_pools] = { "nominatim.openstreetmap.org" => { diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 9736f301a..a2739f403 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -310,7 +310,9 @@ template "#{project_directory}/.env" do :log_file => "#{node[:nominatim][:logdir]}/query.log", :tokenizer => node[:nominatim][:config][:tokenizer], :forward_dependencies => node[:nominatim][:config][:forward_dependencies], - :pool_size => node[:nominatim][:api_pool_size] + :pool_size => node[:nominatim][:api_pool_size], + :query_timeout => node[:nominatim][:api_query_timeout], + :request_timeout => node[:nominatim][:api_request_timeout] end remote_file "#{project_directory}/wikimedia-importance.sql.gz" do diff --git a/cookbooks/nominatim/templates/default/nominatim.env.erb b/cookbooks/nominatim/templates/default/nominatim.env.erb index 472aa4949..9f38b02ff 100644 --- a/cookbooks/nominatim/templates/default/nominatim.env.erb +++ b/cookbooks/nominatim/templates/default/nominatim.env.erb @@ -9,6 +9,8 @@ NOMINATIM_FLATNODE_FILE="<%= @flatnode_file %>" NOMINATIM_SERVE_LEGACY_URLS=yes NOMINATIM_API_POOL_SIZE=<%= @pool_size %> +NOMINATIM_QUERY_TIMEOUT=<%= @query_timeout %> +NOMINATIM_REQUEST_TIMEOUT=<%= @request_timeout %> NOMINATIM_IMPORT_STYLE=extratags -- 2.39.5