1
0
forked from finn/site

uwsgi and thread don't play nice

This commit is contained in:
2024-08-05 14:22:32 +00:00
parent b65daf3784
commit 7c286e1235
2 changed files with 7 additions and 3 deletions

View File

@@ -11,7 +11,9 @@ def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=recipients)
msg.body = text_body
msg.html = html_body
Thread(target=send_async_email, args=(app, msg)).start()
mail.send(msg)
# Thread works surprisingly badly behind uwsgi, just let a uwsgi worker do its thing instead.
#Thread(target=send_async_email, args=(app, msg)).start()
def send_password_reset_email(user):
token = user.get_reset_password_token()