Skip to content
Snippets Groups Projects
Commit 08fec74c authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Use threading.Thread for @background decorator again.

parent 371cd308
No related branches found
No related tags found
No related merge requests found
from . import socketio
from flask import abort, current_app, request
from flask_login import current_user
from functools import wraps
from threading import Thread
def admin_required(f):
......@@ -26,8 +26,8 @@ def background(f):
@wraps(f)
def wrapped(*args, **kwargs):
kwargs['app'] = current_app._get_current_object()
kwargs['current_user'] = current_user._get_current_object()
thread = socketio.start_background_task(f, *args, **kwargs)
thread = Thread(target=f, args=args, kwargs=kwargs)
thread.start()
return thread
return wrapped
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment