Browse Source

Merge branch '896'

James Yen 11 years ago
parent
commit
6755c4a637
3 changed files with 6 additions and 31 deletions
  1. 0 26
      flask/serve_tornado.py
  2. 5 4
      flask/setup_pypy.py
  3. 1 1
      tornado/benchmark_config

+ 0 - 26
flask/serve_tornado.py

@@ -1,26 +0,0 @@
-import tornado.ioloop
-import tornado.web
-import tornado.wsgi
-import tornado.options
-from tornado.options import options
-import tornado.httpserver
-
-tornado.options.define('port', default=8080, type=int, help="Server port")
-tornado.options.define('procs', default=0, type=int, help="Number of processes (default: autodetect)")
-
-
-import app
-wsgiapp = tornado.wsgi.WSGIContainer(app.app.wsgi_app)
-
-import logging
-access_logger = logging.getLogger('tornado.access')
-access_logger.propergate = False
-access_logger.setLevel(logging.WARNING)
-
-
-if __name__ == "__main__":
-    tornado.options.parse_command_line()
-    server = tornado.httpserver.HTTPServer(wsgiapp)
-    server.bind(options.port)
-    server.start(options.procs)
-    tornado.ioloop.IOLoop.instance().start()

+ 5 - 4
flask/setup_pypy.py

@@ -13,13 +13,14 @@ def start(args, logfile, errfile):
     global proc
     setup_util.replace_text("flask/app.py", "DBHOSTNAME", args.database_host)
     proc = subprocess.Popen([
-        bin_dir + "/pypy", "serve_tornado.py",
-        "--port=8080",
-        "--procs="+ str(NCPU*3)],
+        bin_dir + "/gunicorn",
+        "app:app",
+        "-b", "0.0.0.0:8080",
+        '-w', str(NCPU*3),
+        "--log-level=critical"],
         cwd="flask", stderr=errfile, stdout=logfile)
     return 0
 
-
 def stop(logfile, errfile):
     global proc
     if proc is None:

+ 1 - 1
tornado/benchmark_config

@@ -63,6 +63,6 @@
       "display_name": "tornado-py3",
       "notes": "CPython 3.3",
       "versus": ""
-    },
+    }
   }]
 }