code formatting

pull/5761/head
Thibault Duplessis 2019-12-14 20:04:07 -06:00
parent cd65584d02
commit 6e0d9f8302
2 changed files with 6 additions and 4 deletions

View File

@ -33,9 +33,10 @@ final class WorkQueue(buffer: Int, name: String)(implicit ec: ExecutionContext,
private val queue = Source
.queue[TaskWithPromise[_]](buffer, OverflowStrategy.dropNew)
.mapAsync(1) {
case (task, promise) => task() tap promise.completeWith recover {
case e: Exception => lila.log(s"WorkQueue:$name").warn("task failed", e)
}
case (task, promise) =>
task() tap promise.completeWith recover {
case e: Exception => lila.log(s"WorkQueue:$name").warn("task failed", e)
}
}
.toMat(Sink.ignore)(Keep.left)
.run

View File

@ -193,7 +193,8 @@ final class PlaybanApi(
private val rageSitCache = asyncCache.multi[User.ID, RageSit](
name = "playban.ragesit",
f = userId => coll.primitiveOne[RageSit]($doc("_id" -> userId, "c" $exists true), "c").map(_ | RageSit.empty),
f = userId =>
coll.primitiveOne[RageSit]($doc("_id" -> userId, "c" $exists true), "c").map(_ | RageSit.empty),
expireAfter = _.ExpireAfterWrite(30 minutes)
)