rename async decorator to asyncfn

This commit is contained in:
Daniel afx 2022-02-05 03:58:24 +02:00
parent af41410b87
commit a15f7f5145
2 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -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)