Skip to content

Commit

Permalink
Merge pull request #28 from FREVA-CLINT/fix-timeout
Browse files Browse the repository at this point in the history
Increas solr request timeout.
  • Loading branch information
antarcticrainforest authored Apr 18, 2024
2 parents 489182f + 1eff46a commit 66ee928
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/databrowser/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ class SolrSearch:
uniq_keys: Tuple[str, str] = ("file", "uri")
"""The names of all unique keys in the indexing system."""

timeout: aiohttp.ClientTimeout = aiohttp.ClientTimeout(total=5)
"""5 seconds for timeout."""
timeout: aiohttp.ClientTimeout = aiohttp.ClientTimeout(total=30)
"""30 seconds for timeout."""

batch_size: int = 150
"""Maximum solr batch query size for one single query result."""
Expand Down Expand Up @@ -619,9 +619,11 @@ async def _iterintake(self) -> AsyncIterator[str]:
_, results = res
for out in results.get("response", {}).get("docs", [{}]):
source = {
k: out[k][0]
if isinstance(out.get(k), list) and len(out.get(k)) == 1
else out.get(k)
k: (
out[k][0]
if isinstance(out.get(k), list) and len(out.get(k)) == 1
else out.get(k)
)
for k in [self.uniq_key] + self.translator.facet_hierachy
if out.get(k)
}
Expand Down

0 comments on commit 66ee928

Please sign in to comment.