Final cleanup in app context

pull/208/head
M66B 2 years ago
parent d6792fcf2c
commit 2cd47a2700

@ -640,7 +640,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Scheduling,
"### stopped self eventId=" + eventId);
WorkerCleanup.cleanupConditionally(ServiceSynchronize.this);
WorkerCleanup.cleanupConditionally(getApplicationContext());
}
} catch (Throwable ex) {
Log.e(ex);

@ -83,7 +83,7 @@ public class WorkerCleanup extends Worker {
long now = new Date().getTime();
long last_cleanup = prefs.getLong("last_cleanup", 0);
if (last_cleanup + CLEANUP_INTERVAL * 3600 * 1000L > now) {
if (last_cleanup + 2 * CLEANUP_INTERVAL * 3600 * 1000L > now) {
Log.i("Skip cleanup last=" + new Date(last_cleanup));
return;
}

Loading…
Cancel
Save