Add redis to requirements and test for uwsgi to monkeypatch

This commit is contained in:
Jeremy Zhang 2017-08-27 02:22:03 +00:00
parent 0631ccc96d
commit 718fafe0a0
2 changed files with 11 additions and 5 deletions

View File

@ -9,3 +9,4 @@ https://github.com/TitanEmbeds/discord.py/archive/async.zip#egg=discord.py[voice
asyncio_extras asyncio_extras
kombu kombu
redis redis
aioredis

View File

@ -7,12 +7,17 @@ from .blueprints import api, user, admin, embed, gateway
import os import os
from titanembeds.database import get_administrators_list from titanembeds.database import get_administrators_list
if config.get("websockets-mode", None) == "eventlet": try:
import eventlet import uwsgi
eventlet.monkey_patch()
elif config.get("websockets-mode", None) == "gevent":
from gevent import monkey from gevent import monkey
monkey.patch_all() monkey.patch_all()
except:
if config.get("websockets-mode", None) == "eventlet":
import eventlet
eventlet.monkey_patch()
elif config.get("websockets-mode", None) == "gevent":
from gevent import monkey
monkey.patch_all()
os.chdir(config['app-location']) os.chdir(config['app-location'])
app = Flask(__name__, static_folder="static") app = Flask(__name__, static_folder="static")