Fix: app randomly hung when the upload queue is full (#231)

This commit is contained in:
Luis Uguina
2020-05-23 23:10:01 +10:00
committed by GitHub
parent b969077d18
commit 90651fafe8

View File

@@ -55,8 +55,11 @@ public class Log {
} }
private void append(String level_, String msg_) { private void append(String level_, String msg_) {
String line = null;
try {
if (msg_.equals("") == false) { if (msg_.equals("") == false) {
String line = this.dateFormat.format(new java.util.Date()) + " (" + level_ + ") " + msg_; line = this.dateFormat.format(new java.util.Date()) + " (" + level_ + ") " + msg_;
if (this.checkpoints.containsKey(this.lastCheckPoint) && this.checkpoints.get(this.lastCheckPoint) != null) { if (this.checkpoints.containsKey(this.lastCheckPoint) && this.checkpoints.get(this.lastCheckPoint) != null) {
this.checkpoints.get(this.lastCheckPoint).add(line); this.checkpoints.get(this.lastCheckPoint).add(line);
} }
@@ -65,6 +68,10 @@ public class Log {
} }
} }
} }
catch (Exception e) {
// Nothing to do here. Just allow the thread to continue
}
}
public int newCheckPoint() { public int newCheckPoint() {
int time = (int) (new Date().getTime()); int time = (int) (new Date().getTime());