Skip to content

Commit

Permalink
CV2-4741 increase timeout from one to two minutes (#1925)
Browse files Browse the repository at this point in the history
* CV2-4741 increase timeout from one to two minutes

* add CheckConfig for sleep timer
  • Loading branch information
DGaffney committed Jun 13, 2024
1 parent b4a0a7a commit 9e96bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/alegre_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def is_cached_data_not_good(cached_data)
def wait_for_results(project_media, args)
return {} if similarity_disabled_for_project_media?(project_media)
cached_data = get_cached_data(get_required_keys(project_media, nil))
timeout = args[:timeout] || 60
timeout = args[:timeout] || CheckConfig.get('alegre_timeout', 120, :integer).to_f
start_time = Time.now
while start_time + timeout > Time.now && is_cached_data_not_good(cached_data) #more robust for any type of null response
sleep(1)
Expand Down
1 change: 1 addition & 0 deletions config/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ development: &default
similarity_media_file_url_host: ''
min_number_of_words_for_tipline_submit_shortcut: 10
nlu_disambiguation_threshold: 0.11
alegre_timeout: 120

# Localization
#
Expand Down

0 comments on commit 9e96bec

Please sign in to comment.