def register_retries_for_service(service_data, session, service_name, **kwargs): loader = session.get_component('data_loader') endpoint_prefix = service_data.get('metadata', {}).get('endpointPrefix') if endpoint_prefix is None: logger.debug("Not registering retry handlers, could not endpoint " "prefix from model for service %s", service_name) return service_id = service_data.get('metadata', {}).get('serviceId') service_event_name = hyphenize_service_id(service_id) config = _load_retry_config(loader, endpoint_prefix) if not config: return logger.debug("Registering retry handlers for service: %s", service_name) handler = retryhandler.create_retry_handler( config, endpoint_prefix) unique_id = 'retry-config-%s' % service_event_name session.register('needs-retry.%s' % service_event_name, handler, unique_id=unique_id) _register_for_operations(config, session, service_event_name)
def register_retries_for_service(service_data, session, service_name, **kwargs): loader = session.get_component('data_loader') endpoint_prefix = service_data.get('metadata', {}).get('endpointPrefix') if endpoint_prefix is None: logger.debug("Not registering retry handlers, could not endpoint " "prefix from model for service %s", service_name) return service_id = service_data.get('metadata', {}).get('serviceId') service_event_name = hyphenize_service_id(service_id) config = _load_retry_config(loader, endpoint_prefix) if not config: return logger.debug("Registering retry handlers for service: %s", service_name) handler = retryhandler.create_retry_handler( config, endpoint_prefix) unique_id = 'retry-config-%s' % service_event_name session.register('needs-retry.%s' % service_event_name, handler, unique_id=unique_id) _register_for_operations(config, session, service_event_name)
def hyphenize(self): return hyphenize_service_id(self)
def hyphenize(self): return hyphenize_service_id(self)