File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 20
20
ReportPortalService ,
21
21
ReportPortalServiceAsync ,
22
22
)
23
+
24
+ POST_LOGBATCH_RETRY_COUNT = 10
Original file line number Diff line number Diff line change 20
20
import logging
21
21
22
22
from .errors import ResponseError , EntryCreatedError , OperationCompletionError
23
+ from reportportal_client import POST_LOGBATCH_RETRY_COUNT
23
24
24
25
logger = logging .getLogger (__name__ )
25
26
logger .addHandler (logging .NullHandler ())
@@ -291,7 +292,20 @@ def log_batch(self, log_data):
291
292
)
292
293
)]
293
294
files .extend (attachments )
294
- r = self .session .post (url = url , files = files , verify = self .verify_ssl )
295
+ for i in range (POST_LOGBATCH_RETRY_COUNT ):
296
+ try :
297
+ r = self .session .post (
298
+ url = url ,
299
+ files = files ,
300
+ verify = self .verify_ssl
301
+ )
302
+ except KeyError :
303
+ if i < POST_LOGBATCH_RETRY_COUNT - 1 :
304
+ continue
305
+ else :
306
+ raise
307
+ break
308
+
295
309
logger .debug ("log_batch - Stack: %s" , self .stack )
296
310
logger .debug ("log_batch response: %s" , r .text )
297
311
You can’t perform that action at this time.
0 commit comments