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
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
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)
def configure_logging(): log.configure_logging(decapod_api.CONF.logging_config)
def decorator(*args, **kwargs): log.configure_logging(CONF.logging_config) generic.configure_models(db.MongoDB()) return func(*args, **kwargs)