Skip to content

Commit

Permalink
Quick check to help reduce work in some cases, ain't much, but its ho…
Browse files Browse the repository at this point in the history
…nest work
  • Loading branch information
NovaFox161 committed Dec 8, 2024
1 parent 80b8e70 commit 5b5a548
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ class CalendarService(
.updateEvent(calendar, spec)

// This should make sure that any recurring children are removed from cache if this was a recurring parent being updated
eventCache.getAll(guildId)
.filter { it.id.startsWith(event.id) }
.forEach { eventCache.evict(guildId, it.id) }
if (!event.id.contains("_")) {
eventCache.getAll(guildId)
.filter { it.id.startsWith(event.id) }
.forEach { eventCache.evict(guildId, it.id) }
}
eventCache.put(guildId, event.id, event)

cancelEventWizard(guildId, event.id)
Expand All @@ -311,9 +313,11 @@ class CalendarService(
.deleteEvent(calendar, id)

// Make sure if this is a recurring parent, we delete all children from cache
eventCache.getAll(guildId)
.filter { it.id.startsWith(id) }
.forEach { eventCache.evict(guildId, it.id) }
if (!id.contains("_")) {
eventCache.getAll(guildId)
.filter { it.id.startsWith(id) }
.forEach { eventCache.evict(guildId, it.id) }
}

eventMetadataService.deleteEventMetadata(guildId, id)
announcementService.deleteAnnouncements(guildId, id)
Expand Down

0 comments on commit 5b5a548

Please sign in to comment.