コード例 #1
0
ファイル: api.py プロジェクト: southeast02/tricircle
def main():
    config.init(app.common_opts, sys.argv[1:])
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning("Wrong worker number, worker = %(workers)s", workers)
        workers = 1

    LOG.info("Admin API on http://%(host)s:%(port)s with %(workers)s", {
        'host': host,
        'port': port,
        'workers': workers
    })

    service = wsgi.Server(CONF, 'Tricircle Admin_API', application, host, port)
    restapp.serve(service, CONF, workers)

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    restapp.wait()
コード例 #2
0
ファイル: wsgi.py プロジェクト: southeast02/tricircle
def init_application():

    # initialize the config system
    conf_file = _get_config_file()
    config.init(app.common_opts, ['--config-file', conf_file])

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    # return WSGI app
    return app.setup_app()
コード例 #3
0
ファイル: wsgi.py プロジェクト: LongXQ/tricircle
def init_application():

    # initialize the config system
    conf_file = _get_config_file()
    config.init(app.common_opts, ['--config-file', conf_file])

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    # return WSGI app
    return app.setup_app()
コード例 #4
0
ファイル: api.py プロジェクト: Ronghui/tricircle
def main():
    config.init(app.common_opts, sys.argv[1:])
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Admin API on http://%(host)s:%(port)s with %(workers)s"),
             {'host': host, 'port': port, 'workers': workers})

    service = wsgi.Server(CONF, 'Tricircle Admin_API', application, host, port)
    restapp.serve(service, CONF, workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)

    restapp.wait()
コード例 #5
0
ファイル: api.py プロジェクト: kevin-zhangsen/tricircle
def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Server on http://%(host)s:%(port)s with %(workers)s"),
             {'host': host, 'port': port, 'workers': workers})

    serving.run_simple(host, port,
                       application,
                       processes=workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)
コード例 #6
0
def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Server on http://%(host)s:%(port)s with %(workers)s"), {
        'host': host,
        'port': port,
        'workers': workers
    })

    serving.run_simple(host, port, application, processes=workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)