mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Cleanup some timegate code for easier debug.
This commit is contained in:
parent
46f2e6cdd7
commit
6e78deeecf
1 changed files with 8 additions and 3 deletions
|
@ -237,10 +237,15 @@ public class PrefsUtils {
|
|||
prefs.edit().putLong(AppConstants.LAST_SYNC_TIME, (new Date()).getTime()).commit();
|
||||
}
|
||||
|
||||
public static boolean isTimeToVacuum(Context context) {
|
||||
private static long getLastVacuumTime(Context context) {
|
||||
SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
|
||||
long lastTime = prefs.getLong(PrefConstants.LAST_VACUUM_TIME, 1L);
|
||||
return ( (lastTime + AppConstants.VACUUM_TIME_MILLIS) < (new Date()).getTime() );
|
||||
return prefs.getLong(PrefConstants.LAST_VACUUM_TIME, 1L);
|
||||
}
|
||||
|
||||
public static boolean isTimeToVacuum(Context context) {
|
||||
long lastTime = getLastVacuumTime(context);
|
||||
long now = (new Date()).getTime();
|
||||
return ( (lastTime + AppConstants.VACUUM_TIME_MILLIS) < now );
|
||||
}
|
||||
|
||||
public static void updateLastVacuumTime(Context context) {
|
||||
|
|
Loading…
Add table
Reference in a new issue