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

Emrgnt cmplxty patch 2 #255

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Emrgnt cmplxty patch 2 #255

merged 2 commits into from
Apr 1, 2024

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Apr 1, 2024

Ellipsis 🚀 This PR description was created by Ellipsis for commit e63ac47.

Summary:

This PR improves the application's performance by increasing the number of uvicorn server workers and adds robust error handling to the database schema and extension creation process.

Key points:

  • Added --workers 8 to the CMD instruction in the Dockerfile to increase the number of uvicorn server workers.
  • Added exception handling to the vecs schema and vector extension creation process in the __init__ method of the Client class in r2r/vecs/client.py.

Generated with ❤️ by ellipsis.dev

Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
r2r-docs 🔄 Building (Inspect) Visit Preview Apr 1, 2024 5:04am

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review April 1, 2024 05:04
@emrgnt-cmplxty emrgnt-cmplxty merged commit 24cfa04 into main Apr 1, 2024
1 of 2 checks passed
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested.

  • Reviewed the entire pull request up to e63ac47
  • Looked at 41 lines of code in 2 files
  • Took 55 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 0 additional comments because they didn't meet confidence threshold of 50%.

Workflow ID: wflow_jvmEZeFb6y8zmgC0


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.

CMD ["uvicorn", "r2r.examples.basic.app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "8"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making the number of workers configurable through an environment variable instead of hardcoding it to '8'. This would allow for more flexibility depending on the server resources available.

sess.execute(text("create schema if not exists vecs;"))
except Exception as e:
if "already exists" not in str(e):
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider raising a more specific error, such as a DatabaseError, instead of a ValueError. This would provide more context about the nature of the error.

sess.execute(text("create extension if not exists vector;"))
except Exception as e:
if "already exists" not in str(e):
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the previous comment, consider raising a more specific error, such as a DatabaseError, instead of a ValueError.

@emrgnt-cmplxty emrgnt-cmplxty deleted the emrgnt-cmplxty-patch-2 branch April 1, 2024 07:07
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.

1 participant