mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
make dev environment avoid gevent monkey patching
This commit is contained in:
parent
c50292cc16
commit
df450acd3d
1 changed files with 7 additions and 5 deletions
12
pyfedi.py
12
pyfedi.py
|
@ -1,11 +1,13 @@
|
||||||
# This file is part of pyfedi, which is licensed under the GNU General Public License (GPL) version 3.0.
|
# This file is part of pyfedi, which is licensed under the GNU General Public License (GPL) version 3.0.
|
||||||
# You should have received a copy of the GPL along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# You should have received a copy of the GPL along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
import os
|
||||||
|
|
||||||
from gevent import monkey
|
if os.environ.get('FLASK_ENV', '') != 'development':
|
||||||
monkey.patch_all()
|
from gevent import monkey
|
||||||
|
monkey.patch_all()
|
||||||
|
|
||||||
from psycogreen.gevent import patch_psycopg
|
from psycogreen.gevent import patch_psycopg
|
||||||
patch_psycopg()
|
patch_psycopg()
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -13,7 +15,7 @@ from flask_babel import get_locale
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
|
|
||||||
from app import create_app, db, cli
|
from app import create_app, db, cli
|
||||||
import os, arrow
|
import arrow
|
||||||
from flask import session, g, json, request, current_app
|
from flask import session, g, json, request, current_app
|
||||||
from app.constants import POST_TYPE_LINK, POST_TYPE_IMAGE, POST_TYPE_ARTICLE, POST_TYPE_VIDEO, POST_TYPE_POLL, \
|
from app.constants import POST_TYPE_LINK, POST_TYPE_IMAGE, POST_TYPE_ARTICLE, POST_TYPE_VIDEO, POST_TYPE_POLL, \
|
||||||
SUBSCRIPTION_MODERATOR, SUBSCRIPTION_MEMBER, SUBSCRIPTION_OWNER, SUBSCRIPTION_PENDING
|
SUBSCRIPTION_MODERATOR, SUBSCRIPTION_MEMBER, SUBSCRIPTION_OWNER, SUBSCRIPTION_PENDING
|
||||||
|
|
Loading…
Reference in a new issue