You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calls to Elasticsearch, GROBID, and Fatcat API are done as regular synchronous HTTP fetches. FastAPI is an async framework, and we should be making these calls using async code paths (to be clear, meaning async/await syntax, not the /_async_search/ API).
For the citation query code path (requests to GROBID, fatcat elasticsearch, and fatcat API), plan is to move all this code into fuzzycat, and use async versions of code (eg, aiohttp for GROBID and fatcat API, async/await version of elasticsearch python library). For the primary queries, against the fulltext index, waiting on support in elasticsearch-dsl (elastic/elasticsearch-dsl-py#1480). Alternatively, we might be able to use existing elasticsearch-dsl to generate query object (as a dict), and pass that to an async elasticsearch-py function call. Not sure.
The text was updated successfully, but these errors were encountered:
Somewhat embarrassingly, the urgent aspect of this issue has been resolved by simply removing the async and await keywords from methods that make blocking calls. FastAPI will detect this and schedule the calls appropriately.
Calls to Elasticsearch, GROBID, and Fatcat API are done as regular synchronous HTTP fetches. FastAPI is an async framework, and we should be making these calls using async code paths (to be clear, meaning async/await syntax, not the
/_async_search/
API).For the citation query code path (requests to GROBID, fatcat elasticsearch, and fatcat API), plan is to move all this code into fuzzycat, and use async versions of code (eg,
aiohttp
for GROBID and fatcat API, async/await version of elasticsearch python library). For the primary queries, against the fulltext index, waiting on support in elasticsearch-dsl (elastic/elasticsearch-dsl-py#1480). Alternatively, we might be able to use existing elasticsearch-dsl to generate query object (as adict
), and pass that to an async elasticsearch-py function call. Not sure.The text was updated successfully, but these errors were encountered: