tweak chat cache

pull/9913/head
Thibault Duplessis 2021-10-02 12:28:31 +02:00
parent 99ab44b585
commit 486fc19047
1 changed files with 2 additions and 3 deletions

View File

@ -33,9 +33,8 @@ final class ChatApi(
// only use for public, multi-user chats - tournaments, simuls
object cached {
private val cache = cacheApi[Chat.Id, UserChat](128, "chat.user") {
_.expireAfterAccess(1 minute)
.buildAsyncFuture(find)
private val cache = cacheApi[Chat.Id, UserChat](1024, "chat.user") {
_.expireAfterWrite(1 minute).buildAsyncFuture(find)
}
def invalidate = cache.invalidate _