Пример #1
0
def main_script(options, set_shutdown=True):
    if set_shutdown:
        atexit.register(mainloop.shutdown_callback)

    log.configure_logging(CONF.logging_config)
    generic.configure_models(db.MongoDB())

    try:
        return mainloop.main()
    except KeyboardInterrupt:
        pass
Пример #2
0
def main_script(options, set_shutdown=True):
    if set_shutdown:
        atexit.register(mainloop.shutdown_callback)

    log.configure_logging(CONF.logging_config)
    generic.configure_models(db.MongoDB())

    try:
        return mainloop.main()
    except KeyboardInterrupt:
        pass
Пример #3
0
def create_application():
    """Creates and configures WSGI application."""

    application = flask.Flask(__name__)
    application.url_map.strict_slashes = False

    app_config.configure(application)
    handlers.register_handlers(application)
    views.register_api(application)
    generic_model.configure_models(db.MongoDB())

    log.configure_logging(CONF.logging_config)

    return application
Пример #4
0
    def decorator(*args, **kwargs):
        log.configure_logging(CONF.logging_config)

        try:
            func(*args, **kwargs)
        except SystemExit as exc:
            code = HEALTH_NOK
            if exc.code != HEALTH_OK:
                code = HEALTH_OK
        except Exception as exc:
            LOG.error("Healthcheck has been failed with %s", exc)
            code = HEALTH_NOK
        else:
            code = HEALTH_OK

        LOG.info("Finish with exit code %d", code)

        sys.exit(code)
Пример #5
0
def configure_logging():
    log.configure_logging(decapod_api.CONF.logging_config)
Пример #6
0
    def decorator(*args, **kwargs):
        log.configure_logging(CONF.logging_config)
        generic.configure_models(db.MongoDB())

        return func(*args, **kwargs)
Пример #7
0
    def decorator(*args, **kwargs):
        log.configure_logging(CONF.logging_config)
        generic.configure_models(db.MongoDB())

        return func(*args, **kwargs)