Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

♻️ Send account creation email asynchronously via BackgroundTasks#1505

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
saleemasekrea000 wants to merge3 commits intofastapi:master
base:master
Choose a base branch
Loading
fromsaleemasekrea000:feature/background-email

Conversation

@saleemasekrea000
Copy link

Making it a background task improves responsiveness and user experience.
For future
If you need to perform heavy background computation and you don't necessarily need it to be run by the same process (for example, you don't need to share memory, variables, etc), you might benefit from using other bigger tools likeCelery
According to the FastAPI docs :
https://fastapi.tiangolo.com/tutorial/background-tasks/?h=#technical-details

@alejsdevalejsdev changed the titlesend account creation email asynchronously via BackgroundTasks♻️ Send account creation email asynchronously via BackgroundTasksFeb 21, 2025
@saleemasekrea000
Copy link
Author

@alejsdev
Hi, is there any kind of feedback?
It's been a long time...

Copy link
Member

@YuriiMotovYuriiMotov left a comment

Choose a reason for hiding this comment

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

@saleemasekrea000, hello!
Thanks for the interest in project!

The problem here is thatBackgroundTasks can fail silently and in this case user will not receive the email, and admin will not notice it.
With Celery (or other similar tools) we would have retry mechanism to ensure that email has been sent.

Having this I'm not sure it's good idea to move this to BG tasks

saleemasekrea000 reacted with thumbs up emoji
@jishnu70
Copy link

Hi@YuriiMotov ,
This is my first-ever open-source contribution. I’d like to propose making background task support optional:

  • Introduce a booleanUSE_CELERY inconfig.py.
  • IfUSE_CELERY=True, the developer can start Celery + RabbitMQ via a Docker Compose profile, for example:
    docker-compose --profile celery up
  • IfUSE_CELERY=False, only the backend runs:
    docker-compose up

is this approach acceptable?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@YuriiMotovYuriiMotovYuriiMotov left review comments

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@saleemasekrea000@jishnu70@YuriiMotov@alejsdev

[8]ページ先頭

©2009-2025 Movatter.jp