skip all ratelimiting for opening explorer calls

pull/9908/head
Thibault Duplessis 2021-10-19 20:04:20 +02:00
parent 57b4367669
commit 75936175b8
1 changed files with 18 additions and 9 deletions

View File

@ -96,15 +96,24 @@ final class Game(
playerFile = get("players", req),
ongoing = getBool("ongoing", req)
)
val date = DateTimeFormat forPattern "yyyy-MM-dd" print new DateTime
apiC
.GlobalConcurrencyLimitPerIpAndUserOption(req, me)(env.api.gameApiV2.exportByUser(config)) {
source =>
Ok.chunked(source)
.pipe(asAttachmentStream(s"lichess_${user.username}_$date.${format.toString.toLowerCase}"))
.as(gameContentType(config))
}
.fuccess
if (me.exists(_.id == "openingexplorer"))
Ok.chunked(env.api.gameApiV2.exportByUser(config))
.pipe(noProxyBuffer)
.as(gameContentType(config))
.fuccess
else {
val date = DateTimeFormat forPattern "yyyy-MM-dd" print new DateTime
apiC
.GlobalConcurrencyLimitPerIpAndUserOption(req, me)(env.api.gameApiV2.exportByUser(config)) {
source =>
Ok.chunked(source)
.pipe(
asAttachmentStream(s"lichess_${user.username}_$date.${format.toString.toLowerCase}")
)
.as(gameContentType(config))
}
.fuccess
}
}
}
}