Upgrades Server to Allow Production Deployment #2

Merged
osilkin98 merged 10 commits from server_upgrade into master 2019-07-24 08:24:25 +02:00
Showing only changes of commit 6512ec78cd - Show all commits

View file

@ -1,6 +1,8 @@
import logging.config
import logging
import os
import argparse
import sys
from src.settings import config
from src.server.app import run_app
@ -68,7 +70,16 @@ def config_logging_from_settings(conf):
logging.config.dictConfig(_config)
if __name__ == '__main__':
def main(argv=None):
argv = argv or sys.argv[1:]
parser = argparse.ArgumentParser(description='LBRY Comment Server')
parser.add_argument('--port', type=int)
args = parser.parse_args(argv)
if args.port:
config['PORT'] = args.port
config_logging_from_settings(config)
logger = logging.getLogger(__name__)
run_app(config)
run_app(config)
if __name__ == '__main__':
sys.exit(main())