Skip to content

Commit

Permalink
refactor variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitsmt211 committed Nov 12, 2023
1 parent b9f5aed commit 0700661
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ private void handleHistory(SlashCommandInteractionEvent event, Member author, St

List<String> messageIdsForDeletion = new ArrayList<>();

Stream<MessageHistoryRecord> data =
Stream<MessageHistoryRecord> fetchedMessageHistory =
database.writeAndProvide(context -> context.selectFrom(MESSAGE_HISTORY)
.where(MESSAGE_HISTORY.AUTHOR_ID.equal(targetUser.getIdLong())
.and(MESSAGE_HISTORY.CHANNEL_ID.equal(Long.valueOf(sourceChannelId)))
.and(MESSAGE_HISTORY.SENT_AT.greaterOrEqual(purgeMessagesAfter)))
.stream());

try (data) {
data.forEach(messageHistoryRecord -> {
try (fetchedMessageHistory) {
fetchedMessageHistory.forEach(messageHistoryRecord -> {
String messageId = String.valueOf(messageHistoryRecord.getMessageId());
messageIdsForDeletion.add(messageId);
messageHistoryRecord.delete();
Expand Down

0 comments on commit 0700661

Please sign in to comment.