Skip to content

Commit

Permalink
Move minihuey init location
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskr97 committed Sep 18, 2021
1 parent 022649a commit e45d671
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions crashserver/webapp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from pathlib import Path

# fmt: off
from gevent import monkey
monkey.patch_all()
# fmt: on

from huey.contrib.mini import MiniHuey
from sqlalchemy_utils import create_database, database_exists
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
Expand Down Expand Up @@ -98,6 +104,7 @@ def init_web_app() -> Flask:
return app


huey = MiniHuey()
db = SQLAlchemy()
login = LoginManager()
limiter = Limiter(key_func=get_remote_address)
Expand Down
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ def load(self):
logger.info("Starting CrashServer v{}", meta.version("crashserver"))
syscheck.validate_all_settings() # Ensure application has a sane environment

from crashserver.webapp import app
from crashserver.webapp import app, huey

app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1) # Activate proxy pass detection to get real ip
huey.start() # Move huey initialization to main file

# Configure and run gunicorn
options = {
Expand Down

0 comments on commit e45d671

Please sign in to comment.