Skip to content

Commit 7f45223

Browse files
Apply suggestions from code review
Co-authored-by: daniel-zullo-frequenz <[email protected]> Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 2770f7a commit 7f45223

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/frequenz/client/base/channel.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ class KeepAliveOptions:
4747
"""Options for HTTP2 keep-alive pings."""
4848

4949
enabled: bool = True
50-
"""Whether keep-alive should be enabled."""
50+
"""Whether HTTP2 keep-alive should be enabled."""
5151

5252
interval: timedelta = timedelta(seconds=60)
53-
"""The interval between pings."""
53+
"""The interval between HTTP2 pings."""
5454

5555
timeout: timedelta = timedelta(seconds=20)
56-
"""The time in milliseconds to wait for a keep-alive response."""
56+
"""The time to wait for a HTTP2 keep-alive response."""
5757

5858

5959
@dataclasses.dataclass(frozen=True)
@@ -151,19 +151,19 @@ def parse_grpc_uri(
151151
"grpc.keepalive_time_ms",
152152
(
153153
(
154-
options.keep_alive_interval
155-
if options.keep_alive_interval is not None
156-
else defaults.keep_alive.interval
154+
defaults.keep_alive.interval
155+
if options.keep_alive_interval is None
156+
else options.keep_alive_interval
157157
).total_seconds()
158158
* 1000
159159
),
160160
),
161161
(
162162
"grpc.keepalive_timeout_ms",
163163
(
164-
options.keep_alive_timeout
165-
if options.keep_alive_timeout is not None
166-
else defaults.keep_alive.timeout
164+
defaults.keep_alive.timeout
165+
if options.keep_alive_timeout is None
166+
else options.keep_alive_timeout
167167
).total_seconds()
168168
* 1000,
169169
),
@@ -302,12 +302,12 @@ def _parse_query_params(uri: str, query_string: str) -> _QueryParams:
302302
),
303303
keep_alive=keep_alive,
304304
keep_alive_interval=(
305-
timedelta(seconds=int(keep_alive_opts["keep_alive_interval_s"]))
305+
timedelta(seconds=float(keep_alive_opts["keep_alive_interval_s"]))
306306
if keep_alive_opts["keep_alive_interval_s"] is not None
307307
else None
308308
),
309309
keep_alive_timeout=(
310-
timedelta(seconds=int(keep_alive_opts["keep_alive_timeout_s"]))
310+
timedelta(seconds=float(keep_alive_opts["keep_alive_timeout_s"]))
311311
if keep_alive_opts["keep_alive_timeout_s"] is not None
312312
else None
313313
),

0 commit comments

Comments
 (0)