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

Improve Multithreading Implementation in MAIN.PY #60 #67

Closed
wants to merge 2 commits into from

Conversation

Kishore007raj
Copy link

(1). Bug I Identified
There is an issue with the integration of the multithreading logic in main.py. Currently, it runs both the FastAPI and Flask applications concurrently in the background using a ThreadPoolExecutor.

(2). Improvements I Made
Implemented Try-Except Error Handling: I added try-except blocks in appropriate places around the application execution code to capture and handle exceptions, improving the robustness of each application.

(3). Improved Code Readability
I refactored the code and added comments to enhance readability, making it easier for future contributors to understand the multithreading logic they will be working with.

(4). Tests Executed
To validate the changes, I ran the following tests:

Test A: Execution of Multithreading

I ran the two applications, FastAPI and Flask, using the modified main.py file. By simulating normal operation with API calls to both applications, I observed that both applications ran without crashing, and any exceptions were caught and logged correctly, preventing any interruption of the service.

Test B: Error Handling Verification

I triggered scenarios that typically result in errors, such as invalid requests or unavailable services. The error messages in the logs were caught and processed as expected.
The output confirmed that any errors were captured by the try-except blocks, logged appropriately, and did not cause the applications to crash.

Copy link

senior-dev-bot bot commented Oct 8, 2024

Hi there! 👋 Thanks for opening a PR. 🎉 To get the most out of Senior Dev, please sign up in our Web App, connect your GitHub account, and add/join your organization Devasy Patel. After that, you will receive code reviews beginning on your next opened PR. 🚀

@Devasy23
Copy link
Owner

Devasy23 commented Oct 9, 2024

It won't be merged until Python application passes on your branch so please fix that

@Devasy23
Copy link
Owner

@Kishore007raj please resolve the conflict

@Devasy23 Devasy23 linked an issue Oct 12, 2024 that may be closed by this pull request
@Devasy23
Copy link
Owner

@Kishore007raj , please resolve the conflict so I could merge this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Multithreading Implementation in MAIN.PY
2 participants