-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
_ #8
Conversation
Merge pull request #5 from TeamKillerX/main
Reviewer's Guide by SourceryThis PR replaces the HTTP client library from httpx to aiohttp, adds performance logging, and bumps the package version. The changes focus on improving the HTTP client implementation and adding timing metrics for API calls. Sequence diagram for send_log function with aiohttpsequenceDiagram
participant Client
participant aiohttp
Client->>aiohttp: POST /log
alt Response status is 200
aiohttp-->>Client: Return JSON with message
else Response status is not 200
aiohttp-->>Client: Return None
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @xtsea - I've reviewed your changes - here's some feedback:
Overall Comments:
- The change from returning the full response.json() to data["message"] could be a breaking change if the API response doesn't always include a "message" key. Consider adding error handling for this case or maintaining the previous behavior.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
if res is None: | ||
LOGS.warning("Warning: no response API") | ||
LOGS.info(res) | ||
end_time = time.perf_counter() | ||
LOGS.info(f"AIOHTTP: {end_time - start_time:.2f} seconds") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider extracting duplicated performance logging code into a utility function or decorator
This would reduce code duplication between run_image and run methods, making the code more maintainable.
async def log_performance(func):
async def wrapper(*args, **kwargs):
start_time = time.perf_counter()
result = await func(*args, **kwargs)
end_time = time.perf_counter()
LOGS.info(f"AIOHTTP: {end_time - start_time:.2f} seconds")
return result
return wrapper
for more information, see https://pre-commit.ci
Merge pull request #8 from TeamKillerX/main
Summary by Sourcery
Switch to aiohttp for asynchronous HTTP requests and add performance logging to track execution time. Update the version number to 1.2.4.
Enhancements:
Chores: