diff options
Diffstat (limited to 'src/web/decorators.py')
-rw-r--r-- | src/web/decorators.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/web/decorators.py b/src/web/decorators.py deleted file mode 100644 index 3835f646..00000000 --- a/src/web/decorators.py +++ /dev/null @@ -1,27 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- - -from threading import Thread -from functools import wraps - -from flask_login import login_required - - -def async_maker(f): - """ - This decorator enables to launch a task (for examle sending an email or - indexing the database) in background. - This prevent the server to freeze. - """ - def wrapper(*args, **kwargs): - thr = Thread(target=f, args=args, kwargs=kwargs) - thr.start() - return wrapper - - -def pyagg_default_decorator(func): - @login_required - @wraps(func) - def wrapper(*args, **kwargs): - return func(*args, **kwargs) - return wrapper |