diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-02-26 11:27:31 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-02-26 11:27:31 +0100 |
commit | 62b3afeeedfe054345f86093e2d243e956c1e3c9 (patch) | |
tree | bbd58f5c8c07f5d87b1c1cca73fa1d5af6178f48 /src/web/decorators.py | |
parent | Updated Python dependencies. (diff) | |
download | newspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.tar.gz newspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.tar.bz2 newspipe-62b3afeeedfe054345f86093e2d243e956c1e3c9.zip |
The project is now using Poetry.
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 |