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

refactor: Update get_github_installation_ids to use httpx #6451

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 24, 2025

This PR updates the get_github_installation_ids function to use httpx instead of requests with call_sync_from_async. This change makes the code more consistent with other functions in the file and more efficient by using native async HTTP requests.

Changes:

  • Replace requests with httpx.AsyncClient()
  • Use async context manager for better resource management
  • Update error handling to use httpx.HTTPError
  • Remove explicit response.close() as it is handled by the context manager
  • Make the code pattern consistent with other functions in the file

To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0e13a48-nikolaik   --name openhands-app-0e13a48   docker.all-hands.dev/all-hands-ai/openhands:0e13a48

@tofarr tofarr marked this pull request as ready for review January 25, 2025 12:49
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.

2 participants