From f3ec8e0820647a2646c1271840db0212365d89e3 Mon Sep 17 00:00:00 2001 From: John Esmet Date: Sun, 12 May 2019 15:41:56 +0000 Subject: [PATCH] Support reading idle_timeout_ms on the Ambassador module --- ambassador/ambassador/envoy/v2/v2route.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ambassador/ambassador/envoy/v2/v2route.py b/ambassador/ambassador/envoy/v2/v2route.py index 90dbaf8d9e..1496483dbd 100644 --- a/ambassador/ambassador/envoy/v2/v2route.py +++ b/ambassador/ambassador/envoy/v2/v2route.py @@ -91,10 +91,10 @@ def __init__(self, config: 'V2Config', group: IRHTTPMappingGroup) -> None: } } - idle_timeout_ms = group.get('idle_timeout_ms', None) - - if idle_timeout_ms is not None: - route['idle_timeout'] = "%0.3fs" % (idle_timeout_ms / 1000.0) + if 'idle_timeout_ms' in group: + route['idle_timeout'] = "%0.3fs" % (group['idle_timeout_ms']/ 1000.0) + elif 'idle_timeout_ms' in config.ir.ambassador_module: + route['idle_timeout'] = "%0.3fs" % (config.ir.ambassador_module['idle_timeout_ms'] / 1000.0) if group.get('rewrite', None): route['prefix_rewrite'] = group['rewrite']