Skip to content

Commit c83650b

Browse files
committed
Fixes after testing
1 parent a4d7b3c commit c83650b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

reportportal_client/core/log_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ def __init__(self, rp_url, session, api_version, launch_id, project_name,
7575

7676
def _send_batch(self):
7777
"""Send existing batch logs to the worker."""
78-
batch = RPLogBatch(self._batch)
78+
# copy list to not modify batch by `self._batch.clear()`
79+
batch = RPLogBatch(list(self._batch))
7980
http_request = HttpRequest(
8081
self.session.post, self._log_endpoint, files=batch.payload,
8182
verify_ssl=self.verify_ssl)
8283
batch.http_request = http_request
8384
self._worker.send(batch)
8485
self._batch.clear()
85-
self.max_payload_size = helpers.TYPICAL_MULTIPART_FOOTER_LENGTH
86+
self._payload_size = helpers.TYPICAL_MULTIPART_FOOTER_LENGTH
8687

8788
def _log_process(self, log_req):
8889
"""Process the given log request.
@@ -95,7 +96,7 @@ def _log_process(self, log_req):
9596
if len(self._batch) > 0:
9697
self._send_batch()
9798
self._batch.append(log_req)
98-
self.max_payload_size += rq_size
99+
self._payload_size += rq_size
99100
if len(self._batch) >= self.max_entry_number:
100101
self._send_batch()
101102

0 commit comments

Comments
 (0)