Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api/mymdc): fetch MyMDC queries asynchronously #57

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

CammilleCC
Copy link
Member

To avoid blocking the API server during MyMDC fetches, we’re now using aiohttp to handle queries asynchronously. The main slowdown is still from globbing the filesystem for DAMNIT directories, but hopefully, we can work around that in the future.


One can test it by adding the following at the of the metadata/proposals.py:

async def main():
    # print(await get_proposal_info(proposal_num="2956", use_cache=False))
    # print(await get_damnit_proposals(use_cache=False))
    print(await get_available_proposals(user_groups=["scsdata"], use_cache=False))


if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

And run python -m damnit_api.metadata.proposals.

@CammilleCC CammilleCC merged commit ad40360 into main Feb 7, 2025
@CammilleCC CammilleCC deleted the feat/async-mymdc branch February 7, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant