Skip to content

Commit

Permalink
fix: handle size properly
Browse files Browse the repository at this point in the history
Resolves: none.
  • Loading branch information
loay-ashraf committed May 25, 2024
1 parent 757974f commit ba9d7fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Common/Request/Logger/HTTPUploadLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class HTTPUploadLogger {
} else if file.data != nil {
let fileName = file.name
let fileType = file.mimeType.rawValue
let fileSize = file.size
let fileSize = file.size.formattedSize
bodyLogMessage += "{ File From Memory }\n"
bodyLogMessage += "- Name: \(fileName)\n"
bodyLogMessage += "- Type: \(fileType)\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public struct HTTPUploadRequestFile {
self.mimeType = mime
self.size = Int64(data.count)
#if DEBUG
if size > 20_971_520 {
if size > 10_485_760 {
print("* * * * * * * * * * MEMORY WARNING * * * * * * * * * *\n")
print("Holding a large file for upload in the device memory (> 20MB)\nPerformance may be reduced if the available memory is low.")
print("Holding a large file for upload in the device memory (> 10 MB)\nPerformance may be reduced if the available memory is low.")
print("\n* * * * * * * * * * * * * END * * * * * * * * * * * * *\n")
}
#endif
Expand Down

0 comments on commit ba9d7fd

Please sign in to comment.