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

fix: update crawl and upload endpoints #1142

Merged
merged 1 commit into from
Sep 8, 2023
Merged

fix: update crawl and upload endpoints #1142

merged 1 commit into from
Sep 8, 2023

Conversation

mamadoudicko
Copy link
Contributor

  • updae crawl and upload endpoints

@vercel
Copy link

vercel bot commented Sep 8, 2023

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2023 8:56am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2023 8:56am

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/crawl_routes.py

The code changes are generally safe. However, there are a few areas that could be improved for better code quality and maintainability:

  1. The crawl_endpoint function is quite long and does a lot of things. It would be better to break it down into smaller functions for better readability and maintainability.

  2. The if request.headers.get(\"Openai-Api-Key\"): check is done twice in the function. It would be better to do this check once and store the result in a variable.

  3. The if not crawl_website.checkGithub(): and else: blocks have a lot of duplicated code. It would be better to refactor this to avoid code duplication.

  4. The if remaining_free_space - file_size < 0: check could potentially lead to a negative number. It would be safer to use if file_size > remaining_free_space: instead.


Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/upload_routes.py

The code changes are generally safe. However, there are a few areas that could be improved for better code quality and maintainability:

  1. The upload_file function is quite long and does a lot of things. It would be better to break it down into smaller functions for better readability and maintainability.

  2. The if request.headers.get(\"Openai-Api-Key\"): check is done twice in the function. It would be better to do this check once and store the result in a variable.

  3. The if openai_api_key is None: check is done twice in the function. It would be better to do this check once and store the result in a variable.


📚🔍🔄


Powered by Code Review GPT

@gozineb gozineb merged commit 7265970 into main Sep 8, 2023
10 of 11 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
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.

None yet

2 participants