Change inactive account age threshold from 365 to 180 days
This commit is contained in:
parent
70b54e227e
commit
a5f853c67a
|
@ -68,7 +68,7 @@ public class AccountCleaner extends AccountDatabaseCrawlerListener {
|
|||
}
|
||||
|
||||
private static boolean isExpired(Account account) {
|
||||
return account.getLastSeen() + TimeUnit.DAYS.toMillis(365) < System.currentTimeMillis();
|
||||
return account.getLastSeen() + TimeUnit.DAYS.toMillis(180) < System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class AccountCleanerTest {
|
|||
when(undeletedDisabledDevice.isEnabled()).thenReturn(false);
|
||||
when(undeletedDisabledDevice.getGcmId()).thenReturn("foo");
|
||||
when(undeletedDisabledAccount.isEnabled()).thenReturn(false);
|
||||
when(undeletedDisabledAccount.getLastSeen()).thenReturn(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(366));
|
||||
when(undeletedDisabledAccount.getLastSeen()).thenReturn(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(181));
|
||||
when(undeletedDisabledAccount.getMasterDevice()).thenReturn(Optional.of(undeletedDisabledDevice));
|
||||
when(undeletedDisabledAccount.getNumber()).thenReturn("+14152222222");
|
||||
when(undeletedDisabledAccount.getUuid()).thenReturn(UUID.randomUUID());
|
||||
|
@ -64,7 +64,7 @@ class AccountCleanerTest {
|
|||
when(undeletedEnabledAccount.isEnabled()).thenReturn(true);
|
||||
when(undeletedEnabledAccount.getMasterDevice()).thenReturn(Optional.of(undeletedEnabledDevice));
|
||||
when(undeletedEnabledAccount.getNumber()).thenReturn("+14153333333");
|
||||
when(undeletedEnabledAccount.getLastSeen()).thenReturn(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(364));
|
||||
when(undeletedEnabledAccount.getLastSeen()).thenReturn(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(179));
|
||||
when(undeletedEnabledAccount.getUuid()).thenReturn(UUID.randomUUID());
|
||||
|
||||
deletionExecutor = Executors.newFixedThreadPool(2);
|
||||
|
|
Loading…
Reference in New Issue