cache up to 10 events that could be promoted

pull/8864/head
Thibault Duplessis 2021-05-04 14:57:57 +02:00
parent d4105bb2db
commit 51adbb4b34
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ final class EventApi(
lila.i18n.I18nLangPicker.allFromRequestHeaders(req).exists {
_.language == event.lang.language
}
}
}.take(3)
}
private val promotable = cacheApi.unit[List[Event]] {
@ -42,7 +42,7 @@ final class EventApi(
.cursor[Event]()
.list(50)
.dmap {
_.filter(_.featureNow) take 3
_.filter(_.featureNow) take 10
}
def list = coll.find($empty).sort($doc("startsAt" -> -1)).cursor[Event]().list(50)