|
|
@ -129,6 +129,7 @@ public class EntityLog {
|
|
|
|
entry.data = data;
|
|
|
|
entry.data = data;
|
|
|
|
|
|
|
|
|
|
|
|
final DB db = DB.getInstance(context);
|
|
|
|
final DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
final Context acontext = context.getApplicationContext();
|
|
|
|
|
|
|
|
|
|
|
|
executor.submit(new Runnable() {
|
|
|
|
executor.submit(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -164,17 +165,18 @@ public class EntityLog {
|
|
|
|
long now = new Date().getTime();
|
|
|
|
long now = new Date().getTime();
|
|
|
|
if (last_cleanup == null || last_cleanup + LOG_CLEANUP_INTERVAL < now) {
|
|
|
|
if (last_cleanup == null || last_cleanup + LOG_CLEANUP_INTERVAL < now) {
|
|
|
|
last_cleanup = now;
|
|
|
|
last_cleanup = now;
|
|
|
|
cleanup(context, now - LOG_KEEP_DURATION);
|
|
|
|
cleanup(acontext, now - LOG_KEEP_DURATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void clear(final Context context) {
|
|
|
|
static void clear(final Context context) {
|
|
|
|
|
|
|
|
final Context acontext = context.getApplicationContext();
|
|
|
|
executor.submit(new Runnable() {
|
|
|
|
executor.submit(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
cleanup(context, new Date().getTime());
|
|
|
|
cleanup(acontext, new Date().getTime());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|