mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-30 15:25:19 +00:00
Make the app arg in @background functions a bit less magical
This commit is contained in:
@@ -19,8 +19,8 @@ def background(f):
|
||||
''' This decorator executes a function in a Thread '''
|
||||
@wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
app = current_app._get_current_object()
|
||||
thread = Thread(target=f, args=(app, *args), kwargs=kwargs)
|
||||
kwargs['app'] = current_app._get_current_object()
|
||||
thread = Thread(target=f, args=args, kwargs=kwargs)
|
||||
thread.start()
|
||||
return thread
|
||||
return wrapped
|
||||
|
Reference in New Issue
Block a user