Skip to content

Commit

Permalink
Close response after exporting logs to prevent leak
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Jul 26, 2023
1 parent eb23ed5 commit 73975be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions android/app/src/main/java/com/httpsms/LogtailTree.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LogtailTree(val context: Context): Timber.DebugTree() {
t
)
queue.add(logEntry)
if (queue.size < 10) {
if (queue.size < 100) {
return
}

Expand All @@ -50,7 +50,8 @@ class LogtailTree(val context: Context): Timber.DebugTree() {

Thread {
try {
client.newCall(request).execute()
val response = client.newCall(request).execute()
response.body?.close()
} catch(_: Exception) {
}
}.start()
Expand Down

0 comments on commit 73975be

Please sign in to comment.