From 423a1716edad6a553847335c232a1866068ef664 Mon Sep 17 00:00:00 2001 From: lucifercr07 Date: Mon, 10 Jun 2024 23:45:49 +0530 Subject: [PATCH] [FEAT][390] - Addressing review comments --- .../java/com/nonononoki/alovoa/service/ScheduleService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java b/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java index dce7d751..ef8c799f 100644 --- a/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java +++ b/src/main/java/com/nonononoki/alovoa/service/ScheduleService.java @@ -75,9 +75,7 @@ public void cleanNonConfirmedUsers(final Date date) { ms -= nonConfirmedUsersCleanupDelay; Date d = new Date(ms); - List users = userRepo.findByConfirmedIsFalse().stream() - .filter(user -> (user.getDates() != null && user.getDates().getCreationDate().before(d))) - .toList(); + List users = userRepo.findByConfirmedIsFalseAndDatesCreationDateBefore(d); userRepo.deleteAll(users); userRepo.flush();