Fix marshal server TypeError: argument of type 'BentoServiceApi' is not iterable
@@ -184,22 +184,22 @@ class MarshalService:
self.batch_handlers[api_name] = _func
def setup_routes_from_pb(self, bento_service_metadata_pb):
- for api_config in bento_service_metadata_pb.apis:
- if api_config.input_type in BATCH_MODE_SUPPORTED_INPUT_TYPES:
+ for api_pb in bento_service_metadata_pb.apis:
+ if api_pb.input_type in BATCH_MODE_SUPPORTED_INPUT_TYPES:
max_latency = (
- api_config["mb_max_latency"]
- if "mb_max_latency" in api_config
+ api_pb["mb_max_latency"]
+ if "mb_max_latency" in api_pb.input_config
else self._DEFAULT_MAX_LATENCY
)
max_batch_size = (
- api_config["mb_max_batch_size"]
- if "mb_max_batch_size" in api_config
+ api_pb["mb_max_batch_size"]
+ if "mb_max_batch_size" in api_pb.input_config
else self._DEFAULT_MAX_BATCH_SIZE
)
self.add_batch_handler(
- api_config.name, max_latency, max_batch_size,
+ api_pb.name, max_latency, max_batch_size,
)
- logger.info("Micro batch enabled for API `%s`", api_config.name)
+ logger.info("Micro batch enabled for API `%s`", api_pb.name)
async def request_dispatcher(self, request):
with async_trace(
