Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
change ttl into right unit
Browse files Browse the repository at this point in the history
  • Loading branch information
jc-fireball committed Sep 10, 2015
1 parent c86d990 commit 1095b09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,7 @@ Changes by Version

- Actually fix status code being unset in responses when using the Thrift
scheme.
- Fix request TTLs not being propagated over the wire.


0.16.4 (2015-09-09)
Expand Down
4 changes: 2 additions & 2 deletions tchannel/tornado/message_factory.py
Expand Up @@ -97,7 +97,7 @@ def build_raw_request_message(self, request, args, is_completed=False):
if request.state == StreamState.init:
message = CallRequestMessage(
flags=request.flags,
ttl=request.ttl,
ttl=request.ttl * 1000,
tracing=Tracing(request.tracing.span_id,
request.tracing.parent_span_id,
request.tracing.trace_id,
Expand Down Expand Up @@ -206,7 +206,7 @@ def build_request(self, message):
# TODO decide what to pass to Request from message
req = Request(
flags=message.flags,
ttl=message.ttl,
ttl=message.ttl / 1000.0,
tracing=tracing,
service=message.service,
headers=message.headers,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_message_factory.py
Expand Up @@ -37,7 +37,7 @@ def test_build_raw_request_message():
)
req.state = StreamState.init
message = message_factory.build_raw_request_message(req, None, True)
assert message.ttl == req.ttl
assert message.ttl / 1000.0 == req.ttl
assert message.flags == req.flags
assert message.id == req.id
assert message.service == req.service
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_build_request():
)

req = message_factory.build_request(message)
assert req.ttl == message.ttl
assert req.ttl == message.ttl / 1000.0
assert req.flags == message.flags
assert req.headers == message.headers
assert req.id == message.id
Expand Down

0 comments on commit 1095b09

Please sign in to comment.