Skip to content

Commit

Permalink
Merge 09fb5d7 into 3c85c6b
Browse files Browse the repository at this point in the history
  • Loading branch information
Wim-De-Clercq committed Dec 16, 2021
2 parents 3c85c6b + 09fb5d7 commit a84552e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
requests==2.25.0
pyramid==1.10.5

PyYAML==5.3.1
PyYAML==5.4.1

pyramid_urireferencer==0.7.0
5 changes: 4 additions & 1 deletion uriregistry/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from concurrent.futures import ThreadPoolExecutor

from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
Expand Down Expand Up @@ -31,7 +32,9 @@ def get_references(self):
raise HTTPBadRequest('Please include a URI parameter.')

applications = self.request.uri_registry.get_applications(uri)
application_responses = [query_application(app, uri) for app in applications]
with ThreadPoolExecutor(max_workers=len(applications)) as tpe:
futures = [tpe.submit(query_application, app, uri) for app in applications]
application_responses = [future.result(timeout=25) for future in futures]

return _get_registry_response(application_responses, uri)

Expand Down

0 comments on commit a84552e

Please sign in to comment.