Kaynağa Gözat

set up uwsgi to use threads

David 9 yıl önce
ebeveyn
işleme
4046db7c5e
2 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 1 1
      web.py
  2. 4 0
      wsgi.ini

+ 1 - 1
web.py

@@ -6,6 +6,7 @@ from db import db
 from linklist import LinkList
 
 app = Flask(__name__)
+d = db()
 BASEPATH = "/pymnts"
 
 
@@ -158,6 +159,5 @@ def create_task():
 
 
 if __name__ == '__main__':
-    d = db()
     #app.run(host="0.0.0.0", debug=True)
     app.run(host="0.0.0.0", debug=False)

+ 4 - 0
wsgi.ini

@@ -11,3 +11,7 @@ chmod-socket = 666
 vacuum = true
 
 die-on-term = true
+enable-threads = true
+# use threads instead of processes
+lazy-apps = true
+# avoids threadpools to be opened in the master but not in the workers