def __init__(self, argv): self.started = None self.finished = None self.args = self.parser.parse_args() LOGGING['handlers']['console']['level'] = self.args.logging_level for content in LOGGING['loggers'].values(): content['level'] = self.args.logging_level logging.config.dictConfig(LOGGING) self.issns = self.args.issns or [None] es = os.environ.get( 'ELASTICSEARCH_HOST', settings['app:main'].get('elasticsearch_host', '127.0.0.1:9200') ) es_index = os.environ.get( 'ELASTICSEARCH_INDEX', settings['app:main'].get('elasticsearch_index', 'citations') ) self.index = es_index self.controller = controller( hosts=es, timeout=600, sniff_on_connection_fail=True ).set_base_index(index=es_index) self.articlemeta = articlemeta() self.ignore_list = build_ignore_list()
def __init__(self, argv): self.started = None self.finished = None self.args = self.parser.parse_args() LOGGING['handlers']['console']['level'] = self.args.logging_level for content in LOGGING['loggers'].values(): content['level'] = self.args.logging_level logging.config.dictConfig(LOGGING) self.issns = self.args.issns or [None] es = os.environ.get( 'ELASTICSEARCH_HOST', settings['app:main'].get('elasticsearch_host', '127.0.0.1:9200')) es_index = os.environ.get( 'ELASTICSEARCH_INDEX', settings['app:main'].get('elasticsearch_index', 'citations')) self.index = es_index self.controller = controller( hosts=es, timeout=600, sniff_on_connection_fail=True).set_base_index(index=es_index) self.articlemeta = articlemeta() self.ignore_list = build_ignore_list()
def add_controller(request): return controller.controller( aslist(settings['elasticsearch_host']), sniff_on_start=True, sniff_on_connection_fail=True, timeout=60 )
def __init__(self): config = utils.Configuration.from_env() settings = dict(config.items()) self._controller = controller( aslist(settings["app:main"]["elasticsearch_host"]), index=settings["app:main"]["elasticsearch_index"], sniff_on_start=True, sniff_on_connection_fail=True, timeout=60, )
def add_controller(request): es = os.environ.get( 'ELASTICSEARCH_HOST', settings.get('elasticsearch_host', '127.0.0.1:9200')) es_index = os.environ.get( 'ELASTICSEARCH_INDEX', settings.get('elasticsearch_index', 'citations')) return controller.controller(aslist(es), sniff_on_connection_fail=True, timeout=600).set_base_index(es_index)
def __init__(self, argv): self.started = None self.finished = None self.options, self.args = self.parser.parse_args(argv) hosts = aslist(settings['app:main'].get('elasticsearch_host', '127.0.0.1:9200')) index = settings['app:main'].get('elasticsearch_index', 'citations') self.controller = controller( hosts=hosts, timeout=60, sniff_on_start=True, sniff_on_connection_fail=True ) self.articlemeta = articlemeta()
def __init__(self): config = utils.Configuration.from_env() settings = dict(config.items()) self._controller = controller( aslist(settings['app:main']['elasticsearch_host']), index=settings['app:main']['elasticsearch_index'], sniff_on_start=True, sniff_on_connection_fail=True, timeout=600 ) ## Cache Settings Config if 'memcached_host' in settings['app:main']: cache_config = {} cache_config['expiration_time'] = int(settings['app:main'].get('memcached_expiration_time', 2592000)) # a month cache cache_config['arguments'] = {'url': settings['app:main']['memcached_host'], 'binary': True} controller_cache_region.configure('dogpile.cache.pylibmc', **cache_config) else: controller_cache_region.configure('dogpile.cache.null')
def __init__(self): config = utils.Configuration.from_env() settings = dict(config.items()) es = os.environ.get( 'ELASTICSEARCH_HOST', settings['app:main'].get('elasticsearch_host', '127.0.0.1:9200') ) es_index = os.environ.get( 'ELASTICSEARCH_INDEX', settings['app:main'].get('elasticsearch_index', 'citations') ) self._controller = controller( hosts=aslist(es), timeout=600, sniff_on_connection_fail=True ).set_base_index(index=es_index) memcached_host = os.environ.get( 'MEMCACHED_HOST', settings['app:main'].get('memcached_host', None) ) memcached_expiration_time = os.environ.get( 'MEMCACHED_EXPIRATION_TIME', settings['app:main'].get('memcached_expiration_time', 2592000) # a month cache ) ## Cache Settings Config if 'memcached_host' in settings['app:main']: cache_config = {} cache_config['expiration_time'] = int(memcached_expiration_time) # a month cache cache_config['arguments'] = {'url': memcached_host, 'binary': True} controller_cache_region.configure('dogpile.cache.pylibmc', **cache_config) else: controller_cache_region.configure('dogpile.cache.null')
def __init__(self): config = utils.Configuration.from_env() settings = dict(config.items()) es = os.environ.get( 'ELASTICSEARCH_HOST', settings['app:main'].get('elasticsearch_host', '127.0.0.1:9200')) es_index = os.environ.get( 'ELASTICSEARCH_INDEX', settings['app:main'].get('elasticsearch_index', 'citations')) self._controller = controller( hosts=aslist(es), timeout=600, sniff_on_connection_fail=True).set_base_index(index=es_index) memcached_host = os.environ.get( 'MEMCACHED_HOST', settings['app:main'].get('memcached_host', None)) memcached_expiration_time = os.environ.get( 'MEMCACHED_EXPIRATION_TIME', settings['app:main'].get('memcached_expiration_time', 2592000) # a month cache ) ## Cache Settings Config if 'memcached_host' in settings['app:main']: cache_config = {} cache_config['expiration_time'] = int( memcached_expiration_time) # a month cache cache_config['arguments'] = {'url': memcached_host, 'binary': True} controller_cache_region.configure('dogpile.cache.pylibmc', **cache_config) else: controller_cache_region.configure('dogpile.cache.null')