Skip to content

Commit

Permalink
Add logging to troubleshoot attachment file truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel McKnight committed Jul 4, 2024
1 parent 6862e10 commit e77d58c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ def _parse_attachments(files: list) -> dict:
f.seek(0)
f.write(trunc)
f.truncate()
LOG.debug(f"{file} is {getsize(file)/1024} MiB")
LOG.debug(f"{file} is {getsize(file)/1024/1024} MiB")
attachments[basename(file).replace('.log', '_log.txt')] = \
encode_file_to_base64_string(file)
LOG.debug(f"Attachments size={sys.getsizeof(attachments)/1024/1024} MiB")
except Exception as e:
LOG.exception(e)
return attachments
Expand Down

0 comments on commit e77d58c

Please sign in to comment.