Change inactive account age threshold from 365 to 180 days

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2023-05-26 08:23:19 -04:00
1 parent 70b54e227e
commit a5f853c67a
2 files changed
+3 -3

No files matched your search

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