This commit is contained in:
dalbodeule
2024-08-14 20:20:50 +09:00
parent 1e1cd50e52
commit cb5bbf73c3

View File

@@ -19,7 +19,7 @@ object DiscordGuildCache {
private suspend fun getCachedGuilds(guildId: String): Guild? {
val now = Instant.now()
if(cache.isEmpty() || !cache.containsKey(guildId) || cache[guildId]!!.timestamp.plusSeconds(EXP_SECONDS).isBefore(now)) {
if(cache.isEmpty() || !cache.containsKey(guildId) || cache[guildId]!!.timestamp.plusSeconds(EXP_SECONDS).isAfter(now)) {
fetchAllGuilds()
}
return cache[guildId]?.guild