Final cleanup in app context

This commit is contained in:
M66B 2022-06-06 15:20:29 +02:00
parent d6792fcf2c
commit 2cd47a2700
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}