go back to bjoern

This commit is contained in:
cwilvx
2025-03-05 10:19:30 +03:00
parent 1d2e9bc2ab
commit 18f929d6f7
4 changed files with 5 additions and 49 deletions
+3
View File
@@ -101,7 +101,10 @@ class LastFmPlugin(Plugin):
log.warn("scrobble response error" + str(e))
return False
try:
res_json: dict[str, Any] = res.json()
except requests.exceptions.JSONDecodeError:
return False
if res_json.get("error"):
log.error("LASTFM: scrobble error" + str(res_json))
+1 -33
View File
@@ -9,7 +9,6 @@ import waitress
import bjoern
import mimetypes
import setproctitle
import gunicorn.app.base
from flask_jwt_extended import (
create_access_token,
@@ -229,29 +228,6 @@ def print_memory_usage(response: Response):
return response
class StandaloneApplication(gunicorn.app.base.BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app
super().__init__()
def load_config(self):
if not self.cfg:
return
config = {
key: value
for key, value in self.options.items()
if key in self.cfg.settings and value is not None
}
for key, value in config.items():
self.cfg.set(key.lower(), value)
def load(self):
return self.application
if __name__ == "__main__":
load_into_mem()
run_swingmusic()
@@ -270,12 +246,4 @@ if __name__ == "__main__":
# ipv4=True,
# )
# app.run(host=host, port=port, debug=False)
# bjoern.run(app, host, port)
options = {
"bind": f"{host}:{port}",
"workers": 1,
"threads": 100,
"timeout": 0,
}
StandaloneApplication(app, options).run()
bjoern.run(app, host, port)
-1
View File
@@ -34,7 +34,6 @@ dependencies = [
"flask-openapi3==3.0.2",
"rapidfuzz==3.11.0",
"bjoern>=3.2.2",
"gunicorn>=23.0.0",
]
[dependency-groups]
Generated
-14
View File
@@ -498,18 +498,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ac/38/08cc303ddddc4b3d7c628c3039a61a3aae36c241ed01393d00c2fd663473/greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6", size = 1142112 },
]
[[package]]
name = "gunicorn"
version = "23.0.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "packaging" },
]
sdist = { url = "https://files.pythonhosted.org/packages/34/72/9614c465dc206155d93eff0ca20d42e1e35afc533971379482de953521a4/gunicorn-23.0.0.tar.gz", hash = "sha256:f014447a0101dc57e294f6c18ca6b40227a4c90e9bdb586042628030cba004ec", size = 375031 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/cb/7d/6dac2a6e1eba33ee43f318edbed4ff29151a49b5d37f080aad1e6469bca4/gunicorn-23.0.0-py3-none-any.whl", hash = "sha256:ec400d38950de4dfd418cff8328b2c8faed0edb0d517d3394e457c317908ca4d", size = 85029 },
]
[[package]]
name = "idna"
version = "3.10"
@@ -1232,7 +1220,6 @@ dependencies = [
{ name = "flask-cors" },
{ name = "flask-jwt-extended" },
{ name = "flask-openapi3" },
{ name = "gunicorn" },
{ name = "locust" },
{ name = "memory-profiler" },
{ name = "pendulum" },
@@ -1269,7 +1256,6 @@ requires-dist = [
{ name = "flask-cors", specifier = ">=3.0.10" },
{ name = "flask-jwt-extended", specifier = ">=4.6.0" },
{ name = "flask-openapi3", specifier = "==3.0.2" },
{ name = "gunicorn", specifier = ">=23.0.0" },
{ name = "locust", specifier = ">=2.20.1" },
{ name = "memory-profiler", specifier = ">=0.61.0" },
{ name = "pendulum", specifier = ">=3.0.0" },