Change inactive account age threshold from 365 to 180 days

This commit is contained in:
Jon Chambers 2023-05-25 16:16:35 -04:00 committed by Jon Chambers
parent 70b54e227e
commit a5f853c67a
2 changed files with 3 additions and 3 deletions

View File

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

View File

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