Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leezhua17 committed Apr 21, 2023
1 parent 8536d1b commit 91e6288
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

from book import app
from book.schedule import *

from gevent import pywsgi

if __name__ == '__main__':
# print(app.url_map)
print(os.getenv('DEBUG'))
app.run(debug=True,threaded=True,use_reloader=False, port=8000)
# print(os.getenv('DEBUG'))
# app.run(debug=True,threaded=True,use_reloader=False, port=8000)
server = pywsgi.WSGIServer(('0.0.0.0',8000),app)
server.serve_forever()
3 changes: 2 additions & 1 deletion book/views/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def user_add():
def user_setting():
"""用户设置"""
param = request.get_json()
user = get_jwt_identity()
if 'timezone' in param: # 同步更新用户的 timezone
userinfo = User.get_by_id(param['id'])
userinfo = User.get_by_id(user['id'])
userinfo.timezone = param['timezone']
db.session.add(userinfo)
db.session.commit()
Expand Down
7 changes: 5 additions & 2 deletions gunicorn-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"""

bind = '0.0.0.0:8000'
workers = 4
# workers = 2
threads = 2
worker_class = 'gevent'
accesslog = '-'
loglevel = 'debug'
loglevel = 'info'
capture_output = True
enable_stdio_inheritance = True
pidfile = "logs/gunicorn.pid"
timeout = 60
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ cachelib==0.9.0
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
cryptography==40.0.1
docutils==0.19
feedparser==6.0.10
Flask==2.2.3
Expand All @@ -16,6 +14,7 @@ Flask-Mail==0.9.1
Flask-Principal==0.4.0
Flask-SQLAlchemy==3.0.3
Genshi==0.7.7
gevent==22.10.2
greenlet==2.0.2
gunicorn==20.1.0
idna==3.4
Expand Down Expand Up @@ -47,3 +46,5 @@ tzlocal==4.3
urllib3==1.26.15
Werkzeug==2.2.3
zipp==3.15.0
zope.event==4.6
zope.interface==6.0

0 comments on commit 91e6288

Please sign in to comment.