refactor: separate http handler specifics from optimzer#88
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the optimizer codebase by separating HTTP request handling logic from the core optimizer execution logic. The main goal is to improve modularity by moving HTTP-specific concerns (Redis queue management, job handling, client disconnection checks) into a dedicated handler module.
Key Changes:
- Created a new
optimizer_handler.pymodule to handle HTTP requests and job queue management - Refactored
optimizer.pyto contain only the core optimizer execution logic - Updated import references in tests and OpenAPI specification to point to the new handler module
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| optimizerapi/optimizer_handler.py | New file containing HTTP request handlers, Redis/RQ job management, and client disconnection logic previously in optimizer.py |
| optimizerapi/optimizer.py | Simplified to contain only core optimizer execution logic; removed HTTP-specific dependencies (connexion, Redis, RQ) and handler functions |
| tests/test_optimizer.py | Updated import statement to use the new optimizer_handler module |
| optimizerapi/openapi/specification.yml | Updated operationId to reference the new optimizer_handler.run function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.