Dont need so many workers
This commit is contained in:
parent
b2818204ee
commit
ec4b40bb81
1 changed files with 1 additions and 3 deletions
|
@ -2,7 +2,6 @@ from sanic import Sanic
|
|||
from sanic_useragent import SanicUserAgent
|
||||
from lantern.args import parse_args
|
||||
from lantern.route import build_main_route
|
||||
import os
|
||||
|
||||
app = Sanic(__name__)
|
||||
SanicUserAgent.init_app(app)
|
||||
|
@ -10,8 +9,7 @@ SanicUserAgent.init_app(app)
|
|||
|
||||
def main():
|
||||
args = parse_args()
|
||||
workers = os.cpu_count() or 1
|
||||
main_route = build_main_route(args)
|
||||
app.add_route(main_route, "/<path>")
|
||||
app.add_route(main_route, "/")
|
||||
app.run(host="0.0.0.0", port=args.port, workers=workers)
|
||||
app.run(host="0.0.0.0", port=args.port)
|
||||
|
|
Reference in a new issue