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

feat(concurrency): added concurrency for increased performance #1189

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

StanGirard
Copy link
Collaborator

Added concurrency 4 for celery and 6 for backend

@StanGirard StanGirard temporarily deployed to preview September 17, 2023 20:32 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Sep 17, 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 17, 2023 8:35pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2023 8:35pm

@github-actions
Copy link
Contributor

Risk Level 2 - /home/runner/work/quivr/quivr/backend/models/databases/supabase/notifications.py

The get_notifications_by_chat_id function has been modified to only return notifications from the last 5 minutes. This could potentially cause issues if older notifications are expected elsewhere in the code. If this is the intended behavior, consider renaming the function to reflect this, for example get_recent_notifications_by_chat_id. Also, the datetime format string is hard-coded which could lead to issues if the format changes. Consider defining it as a constant at the top of your file.

DATETIME_FORMAT = \"%Y-%m-%d %H:%M:%S.%f\"

# later in the code
five_minutes_ago = (datetime.now() - timedelta(minutes=5)).strftime(DATETIME_FORMAT)

Risk Level 4 - /home/runner/work/quivr/quivr/backend/celery_worker.py

The openai_api_key is being passed around in plain text which is a security risk. Consider using environment variables or a secure way to handle sensitive data like API keys. Also, the CELERY_BROKER_URL is being used without any validation. It's better to validate this URL before using it. Here is a suggestion:

import os
from urllib.parse import urlparse

CELERY_BROKER_URL = os.getenv(\"CELERY_BROKER_URL\", \"\")

parsed_url = urlparse(CELERY_BROKER_URL)
if not all([parsed_url.scheme, parsed_url.netloc]):
    raise ValueError(f\"Invalid broker URL: {CELERY_BROKER_URL}\")

⏰🔒🔧


Powered by Code Review GPT

@StanGirard StanGirard merged commit 2e4fdc8 into main Sep 17, 2023
9 of 10 checks passed
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

1 participant