mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
fix: setup beginning before folders are created
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ ALLARGS = settings.ALLARGS
|
|||||||
ARGS = sys.argv[1:]
|
ARGS = sys.argv[1:]
|
||||||
|
|
||||||
|
|
||||||
class HandleArgs:
|
class ProcessArgs:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.handle_build()
|
self.handle_build()
|
||||||
self.handle_host()
|
self.handle_host()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import waitress
|
|||||||
import setproctitle
|
import setproctitle
|
||||||
|
|
||||||
from app.api import create_api
|
from app.api import create_api
|
||||||
from app.arg_handler import HandleArgs
|
from app.arg_handler import ProcessArgs
|
||||||
from app.lib.watchdogg import Watcher as WatchDog
|
from app.lib.watchdogg import Watcher as WatchDog
|
||||||
from app.periodic_scan import run_periodic_scans
|
from app.periodic_scan import run_periodic_scans
|
||||||
from app.plugins.register import register_plugins
|
from app.plugins.register import register_plugins
|
||||||
@@ -47,9 +47,8 @@ mimetypes.add_type("application/manifest+json", ".webmanifest")
|
|||||||
werkzeug = logging.getLogger("werkzeug")
|
werkzeug = logging.getLogger("werkzeug")
|
||||||
werkzeug.setLevel(logging.ERROR)
|
werkzeug.setLevel(logging.ERROR)
|
||||||
|
|
||||||
# Set up the application
|
|
||||||
HandleArgs()
|
|
||||||
|
|
||||||
|
# Background tasks
|
||||||
@background
|
@background
|
||||||
def bg_run_setup() -> None:
|
def bg_run_setup() -> None:
|
||||||
run_periodic_scans()
|
run_periodic_scans()
|
||||||
@@ -63,7 +62,6 @@ def start_watchdog():
|
|||||||
@background
|
@background
|
||||||
def run_swingmusic():
|
def run_swingmusic():
|
||||||
log_startup_info()
|
log_startup_info()
|
||||||
run_setup()
|
|
||||||
bg_run_setup()
|
bg_run_setup()
|
||||||
register_plugins()
|
register_plugins()
|
||||||
|
|
||||||
@@ -72,6 +70,9 @@ def run_swingmusic():
|
|||||||
setproctitle.setproctitle(f"swingmusic ::{FLASKVARS.get_flask_port()}")
|
setproctitle.setproctitle(f"swingmusic ::{FLASKVARS.get_flask_port()}")
|
||||||
|
|
||||||
|
|
||||||
|
# Setup function calls
|
||||||
|
ProcessArgs()
|
||||||
|
run_setup()
|
||||||
Info.load()
|
Info.load()
|
||||||
run_swingmusic()
|
run_swingmusic()
|
||||||
|
|
||||||
@@ -189,10 +190,7 @@ def print_memory_usage(response: Response):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
host = FLASKVARS.get_flask_host()
|
host = FLASKVARS.get_flask_host()
|
||||||
port = FLASKVARS.get_flask_port()
|
port = FLASKVARS.get_flask_port()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user