декртатор для запуска запланированных задач

This commit is contained in:
2025-12-20 13:22:19 +03:00
parent 50daed590a
commit a8be6d7789
3 changed files with 14 additions and 2 deletions
+10
View File
@@ -334,6 +334,16 @@ def api_posts():
return jsonify({"status": "error"}), 405
def with_app_context(func):
def wrapper(*args, **kwargs):
from app import app
with app.app_context():
return func(*args, **kwargs)
return wrapper
if __name__ == "__main__":
# app.run(debug=True)
app.run(debug=True, host="0.0.0.0", port=80)