diff --git a/.gitignore b/.gitignore index 2ea3a5e70..fec1a4e93 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ testing/cypress/videos docker/ delete/ *.backup +swagger.json # Created by https://www.toptal.com/developers/gitignore/api/pycharm,flask,python # Edit at https://www.toptal.com/developers/gitignore?templates=pycharm,flask,python diff --git a/app/__init__.py b/app/__init__.py index 60cbcffb4..96849daf7 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -20,6 +20,7 @@ from .utils.babel_locale import get_locale from .utils.check_enviroment import check_enviroment from .utils.compile_swagger import compile_swagger +from .utils.clear_logs import clear_logs BASE_DIR = path.abspath(path.dirname(__file__)) @@ -75,7 +76,8 @@ # Clear cache on startup with app.app_context(): cache.clear() - compile_swagger(api) + clear_logs() + # compile_swagger(api) # Register Jinja2 filters register_filters(app) diff --git a/app/configs/settings.json.j2 b/app/configs/settings.json.j2 index 48011b0b1..28eb1a282 100644 --- a/app/configs/settings.json.j2 +++ b/app/configs/settings.json.j2 @@ -35,14 +35,18 @@ "roles": ["moderator", "user"], "icon": "fas fa-bell", "url": "/partials/admin/settings/notifications", - "push_url": "/admin/settings/notifications" + "push_url": "/admin/settings/notifications", + "class": "coming-soon", + "disabled": true }, { "title": "{{ _('Discord Bot') }}", "description": "{{ _('Configure Discord bot settings') }}", "icon": "fab fa-discord", "url": "/partials/admin/settings/discord-bot", - "push_url": "/admin/settings/discord-bot" + "push_url": "/admin/settings/discord-bot", + "class": "coming-soon", + "disabled": true } ] }, diff --git a/app/scheduler.py b/app/scheduler.py index b186b83ce..b628d913a 100644 --- a/app/scheduler.py +++ b/app/scheduler.py @@ -57,7 +57,7 @@ def scan_users(): info("Scanning for new users") global_sync_users() -@schedule.task("interval", id="checkForUpdates", minutes=10, misfire_grace_time=900) +@schedule.task("interval", id="checkForUpdates", hours=1, misfire_grace_time=900) def check_for_updates(): # Import the function here to avoid circular imports from app.utils.software_lifecycle import need_update diff --git a/app/utils/clear_logs.py b/app/utils/clear_logs.py new file mode 100644 index 000000000..bc6b7736a --- /dev/null +++ b/app/utils/clear_logs.py @@ -0,0 +1,12 @@ +from flask_restx import Api +from json import dumps +from os import path + +def clear_logs(): + """Clear the logs.log file on startup""" + base_dir = path.dirname(path.dirname(path.dirname(path.abspath(__file__)))) + + # Clear log file contents on startup + if path.exists(path.join(base_dir, "../", "database", "logs.log")): + with open(path.join(base_dir, "../", "database", "logs.log"), "w", encoding="utf-8") as f: + f.write("") diff --git a/app/utils/compile_swagger.py b/app/utils/compile_swagger.py index 706c865a3..81dee1d85 100644 --- a/app/utils/compile_swagger.py +++ b/app/utils/compile_swagger.py @@ -11,7 +11,3 @@ def compile_swagger(api: Api): with open(path.join(base_dir, "../", "swagger.json"), "w", encoding="utf-8") as f: f.write(dumps(swagger_data)) - # Clear log file contents on startup - if path.exists(path.join(base_dir, "../", "database", "logs.log")): - with open(path.join(base_dir, "../", "database", "logs.log"), "w", encoding="utf-8") as f: - f.write("") diff --git a/package.json b/package.json index 1f2c425e6..85412b453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Wizarr", - "version": "3.0.3", + "version": "3.0.4", "description": "Wizarr is a web application that allows you to share your media library with your friends and family with ease.", "scripts": { "server:start": "APP_URL=127.0.0.1:5000 flask run", diff --git a/swagger.json b/swagger.json deleted file mode 100644 index 1dbe0df2d..000000000 --- a/swagger.json +++ /dev/null @@ -1 +0,0 @@ -{"error": "Unable to render schema"} \ No newline at end of file