fix: Cleanup code to comply with ruff
Some checks failed
Check Code Quality / RuffCheck (push) Successful in 43s
Build Docker / BuildImage (push) Failing after 1m10s

This commit is contained in:
2025-11-20 15:44:56 +11:00
parent d4ca53c46f
commit c7d5b98507
2 changed files with 13 additions and 23 deletions

20
main.py
View File

@@ -1,5 +1,3 @@
from flask import Flask
from server import app
import server
from gunicorn.app.base import BaseApplication
import os
@@ -20,23 +18,21 @@ class GunicornApp(BaseApplication):
def load(self):
return self.application
if __name__ == '__main__':
if __name__ == "__main__":
dotenv.load_dotenv()
workers = os.getenv('WORKERS', 1)
threads = os.getenv('THREADS', 2)
workers = os.getenv("WORKERS", 1)
threads = os.getenv("THREADS", 2)
workers = int(workers)
threads = int(threads)
options = {
'bind': '0.0.0.0:5000',
'workers': workers,
'threads': threads,
"bind": "0.0.0.0:5000",
"workers": workers,
"threads": threads,
}
gunicorn_app = GunicornApp(server.app, options)
print(f'Starting server with {workers} workers and {threads} threads', flush=True)
print(f"Starting server with {workers} workers and {threads} threads", flush=True)
gunicorn_app.run()