|
|
@ -41,6 +41,7 @@ class LogzioSender: |
|
|
|
self.logger = get_logger(debug) |
|
|
|
self.backup_logs = backup_logs |
|
|
|
self.network_timeout = network_timeout |
|
|
|
self.requests_session = requests.Session() |
|
|
|
|
|
|
|
# Function to see if the main thread is alive |
|
|
|
self.is_main_thread_active = lambda: any( |
|
|
@ -110,7 +111,7 @@ class LogzioSender: |
|
|
|
for current_try in range(number_of_retries): |
|
|
|
should_retry = False |
|
|
|
try: |
|
|
|
response = requests.post( |
|
|
|
response = self.requests_session.post( |
|
|
|
self.url, headers=headers, data='\n'.join(logs_list), |
|
|
|
timeout=self.network_timeout) |
|
|
|
if response.status_code != 200: |
|
|
|