From a15f7f51450061a98b7730a1d6b0d11937ad89f7 Mon Sep 17 00:00:00 2001 From: Daniel afx Date: Sat, 5 Feb 2022 03:58:24 +0200 Subject: [PATCH] rename async decorator to asyncfn --- flask/forest/decorators.py | 2 +- flask/forest/email.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flask/forest/decorators.py b/flask/forest/decorators.py index c3217c1..f1cc953 100644 --- a/flask/forest/decorators.py +++ b/flask/forest/decorators.py @@ -4,7 +4,7 @@ from flask_login import current_user from .models import Permission from threading import Thread -def async(f): +def asyncfn(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() diff --git a/flask/forest/email.py b/flask/forest/email.py index 706a96f..f0d923e 100644 --- a/flask/forest/email.py +++ b/flask/forest/email.py @@ -2,9 +2,9 @@ from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import app, mail -from decorators import async +from decorators import asyncfn -@async +@asyncfn def send_async_email(app, msg): with app.app_context(): mail.send(msg)