Skip to content

Commit

Permalink
Fixing task to bytes serializing function
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavogaldinoo committed Aug 13, 2024
1 parent 52eacb1 commit 632f23f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion experiment/measurer/measure_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ def _task_to_bytes(
self, task: measurer_datatypes.SnapshotMeasureRequest) -> bytes:
"""Takes a snapshot measure request task and transform it into bytes, so
it can be published in a pub sub queue."""
task_as_dict = task.__dict__
task_as_dict = task._asdict()
return json.dumps(task_as_dict).encode('utf-8')

def put_task_in_request_queue(
Expand Down
2 changes: 1 addition & 1 deletion experiment/measurer/measure_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,5 @@ def put_result_in_response_queue(self, measured_snapshot, request):
request.fuzzer, request.benchmark, request.trial_id,
request.cycle)
retry_request_encoded = json.dumps(
retry_request.__dict__).encode('utf-8')
retry_request._asdict()).encode('utf-8')
self.publisher_client.publish(topic_path, retry_request_encoded)

0 comments on commit 632f23f

Please sign in to comment.