Commit 8e48dbda authored by wanli's avatar wanli

🌈 style(): 修改新版应用商店配置方式

parent e13571a0
...@@ -8,7 +8,7 @@ class ProductionConfig(object): ...@@ -8,7 +8,7 @@ class ProductionConfig(object):
EPK_DIR = "D:\\projects\\scriptiot\\evm_app_store_files\\epks" EPK_DIR = "D:\\projects\\scriptiot\\evm_app_store_files\\epks"
UPLOAD_ROOT_DIR = "D:\\projects\\scriptiot\\evm_app_store_files" UPLOAD_ROOT_DIR = "D:\\projects\\scriptiot\\evm_app_store_files"
UPLOAD_ALLOWED = set(['doc', 'docs', 'csv', 'xls', 'xlsx']) UPLOAD_ALLOWED = set(['doc', 'docs', 'csv', 'xls', 'xlsx'])
BIND = '127.0.0.1:3000' BIND = '127.0.0.1:3001'
WORKERS = multiprocessing.cpu_count() * 2 + 1 WORKERS = multiprocessing.cpu_count() * 2 + 1
WORKER_CONNECTIONS = 10000 WORKER_CONNECTIONS = 10000
BACKLOG = 64 BACKLOG = 64
...@@ -47,7 +47,7 @@ class DevelopConfig(object): ...@@ -47,7 +47,7 @@ class DevelopConfig(object):
EPK_DIR = "D:\\projects\\scriptiot\\evm_app_store_files\\epks" EPK_DIR = "D:\\projects\\scriptiot\\evm_app_store_files\\epks"
UPLOAD_ROOT_DIR = "D:\\projects\\scriptiot\\evm_app_store_files" UPLOAD_ROOT_DIR = "D:\\projects\\scriptiot\\evm_app_store_files"
UPLOAD_ALLOWED = set(['doc', 'docs', 'csv', 'xls', 'xlsx']) UPLOAD_ALLOWED = set(['doc', 'docs', 'csv', 'xls', 'xlsx'])
BIND = '127.0.0.1:3000' BIND = '127.0.0.1:3001'
WORKERS = 2 WORKERS = 2
WORKER_CONNECTIONS = 1000 WORKER_CONNECTIONS = 1000
BACKLOG = 64 BACKLOG = 64
......
''' '''
Author: your name Author: your name
Date: 2021-07-15 09:33:39
LastEditTime: 2021-07-28 19:56:22
LastEditors: your name
Description: In User Settings Edit
FilePath: \evm-store\tools\build_out\manager.py
'''
'''
Author: your name
Date: 2021-06-15 17:40:09 Date: 2021-06-15 17:40:09
LastEditTime: 2021-06-30 18:09:51 LastEditTime: 2021-06-30 18:09:51
LastEditors: Please set LastEditors LastEditors: Please set LastEditors
...@@ -20,6 +28,9 @@ app = create_app(config) ...@@ -20,6 +28,9 @@ app = create_app(config)
migrate = Migrate(app, db) migrate = Migrate(app, db)
manager = Manager(app) manager = Manager(app)
host, port = tuple(config.BIND.split(":"))
print("===============>", host, port)
@manager.command @manager.command
def run(): def run():
""" """
...@@ -29,7 +40,7 @@ def run(): ...@@ -29,7 +40,7 @@ def run():
# app.logger.setLevel(app.config.get('LOG_LEVEL', logging.INFO)) # app.logger.setLevel(app.config.get('LOG_LEVEL', logging.INFO))
http_server = HTTPServer(WSGIContainer(app)) http_server = HTTPServer(WSGIContainer(app))
http_server.listen(3000, address='127.0.0.1', xheaders=True) http_server.listen(int(port), address=host, xheaders=True)
IOLoop.instance().start() IOLoop.instance().start()
@manager.command @manager.command
...@@ -39,7 +50,7 @@ def debug(): ...@@ -39,7 +50,7 @@ def debug():
To use: python3 manager.py debug To use: python3 manager.py debug
""" """
# app.logger.setLevel(logging.DEBUG) # app.logger.setLevel(logging.DEBUG)
app.run(debug=True, port=3000, host='127.0.0.1') app.run(debug=True, port=int(port), host=host)
if __name__ == '__main__': if __name__ == '__main__':
manager.run() manager.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment