File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1424,16 +1424,20 @@ def send_logs(
1424
1424
platform .system (), self .url , self .username ()
1425
1425
)
1426
1426
1427
+ # We send more from the local logs
1428
+ global_logs_file_size_to_send = MAX_LOG_FILE_SIZE_TO_SEND * 0.2
1429
+ local_logs_file_size_to_send = MAX_LOG_FILE_SIZE_TO_SEND * 0.8
1430
+
1427
1431
global_logs = b""
1428
1432
if global_log_file and os .path .exists (global_log_file ):
1429
1433
with open (global_log_file , "rb" ) as f :
1430
- if os .path .getsize (global_log_file ) > LOG_FILE_SIZE_TO_SEND :
1431
- f .seek (- LOG_FILE_SIZE_TO_SEND , os .SEEK_END )
1434
+ if os .path .getsize (global_log_file ) > global_logs_file_size_to_send :
1435
+ f .seek (- global_logs_file_size_to_send , os .SEEK_END )
1432
1436
global_logs = f .read () + b"\n --------------------------------\n \n "
1433
1437
1434
1438
with open (logfile , "rb" ) as f :
1435
- if os .path .getsize (logfile ) > 512 * 1024 :
1436
- f .seek (- 512 * 1024 , os .SEEK_END )
1439
+ if os .path .getsize (logfile ) > local_logs_file_size_to_send :
1440
+ f .seek (- local_logs_file_size_to_send , os .SEEK_END )
1437
1441
logs = f .read ()
1438
1442
1439
1443
payload = meta .encode () + global_logs + logs
Original file line number Diff line number Diff line change 7
7
UPLOAD_CHUNK_SIZE = 10 * 1024 * 1024
8
8
9
9
# size of the log file part to send (if file is larger only this size from end will be sent)
10
- LOG_FILE_SIZE_TO_SEND = 100 * 1024
10
+ MAX_LOG_FILE_SIZE_TO_SEND = 8 * 1024 * 1024
11
11
12
12
# default URL for submitting logs
13
13
MERGIN_DEFAULT_LOGS_URL = "https://g4pfq226j0.execute-api.eu-west-1.amazonaws.com/mergin_client_log_submit"
You can’t perform that action at this time.
0 commit comments