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

Lock Implementation for endpoints that send emails #37

Merged
merged 6 commits into from
Feb 24, 2024

Conversation

aditya-gitte
Copy link
Collaborator

Added Locks

  • The locking mechanism has been carried forward from Shoonya
  • Locks have been added to only the endpoints that call a celery task to send email
  • All locks are stored in Redis
  • This implementation is fail safe, i.e in case of any failure in this mechanism the normal functioning of neither the task nor the endpoint is hindered

Modified endpoints and tasks

Enpoint Celery Task Django App
project_analytics send_project_analysis_reports_mail_ws workspaces
user_analytics send_user_analysis_reports_mail_ws workspaces
send_user_analytics send_user_reports_mail_ws workspaces
download_all_projects schedule_mail_to_download_all_projects functions
schedule_project_reports_email schedule_mail_for_project_reports functions

Env variables required

REDIS_HOST=
REDIS_PORT=
DEFAULT_CELERY_LOCK_TIMEOUT=
  • Note: the DEFAULT_CELERY_LOCK_TIMEOUT takes in values in seconds

@ishvindersethi22 ishvindersethi22 merged commit 0dbf3ba into dev Feb 24, 2024
1 check 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.

2 participants