Skip to content

Commit

Permalink
fix/huge_integer_error (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Oct 23, 2023
1 parent 5f2ecec commit fd6f1a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ovos_bus_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, timeout: int = None,

config = Configuration().get('context', {})
if timeout is None:
timeout = config.get('timeout', 2)
timeout = config.get('timeout', 2) * 60 # minutes to seconds
if greedy is None:
greedy = config.get('greedy', False)
if keywords is None:
Expand All @@ -105,7 +105,7 @@ def __init__(self, timeout: int = None,
max_frames = config.get('max_frames', 3)

self.frame_stack = frame_stack or []
self.timeout = timeout * 60 # minutes to seconds
self.timeout = timeout
self.context_keywords = keywords
self.context_max_frames = max_frames
self.context_greedy = greedy
Expand All @@ -125,7 +125,7 @@ def deserialize(data: dict):
@param data: serialized (dict) data
@return: IntentContextManager for the specified data
"""
timeout = data.get("timeout", 2)
timeout = data.get("timeout", 2 * 60)
framestack = [(IntentContextManagerFrame.deserialize(f), t)
for (f, t) in data.get("frame_stack", [])]
return IntentContextManager(timeout, framestack)
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_serialize_deserialize(self):
new_ctx = new_serial.pop('context')
self.assertEqual(new_serial, serialized)
self.assertEqual(ctx['frame_stack'], new_ctx['frame_stack'])
self.assertGreater(new_ctx['timeout'], ctx['timeout'])
self.assertEqual(new_ctx['timeout'], ctx['timeout'])

# Test default value deserialize
test_session = Session.deserialize(dict())
Expand Down

0 comments on commit fd6f1a6

Please sign in to comment.