Devasy23 / FaceRec

An advanced facial recognition system designed for real-time identification using deep learning models and optimized vector search. Features include face detection, embedding generation, and scalable deployment options.
Apache License 2.0
31 stars 30 forks source link

Improve Multithreading Implementation in MAIN.PY #60 #67

Closed Kishore007raj closed 4 weeks ago

Kishore007raj commented 1 month ago

(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.

senior-dev-bot[bot] commented 1 month ago

Hi there! :wave: Thanks for opening a PR. :tada: 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. :rocket:

Devasy23 commented 1 month ago

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

Devasy23 commented 1 month ago

@Kishore007raj please resolve the conflict

Devasy23 commented 4 weeks ago

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