apply play2 master BC breaks
parent
6dcaf05c80
commit
ee947f30d1
|
@ -89,7 +89,7 @@ trait WithPlay extends Zeros { self: PackageObject ⇒
|
|||
|
||||
import play.api.libs.json._
|
||||
|
||||
implicit def playDefaultContext = play.api.libs.concurrent.Execution.defaultContext
|
||||
implicit def execontext = play.api.libs.concurrent.Execution.defaultContext
|
||||
|
||||
// Typeclasses
|
||||
implicit val LilaFutureFunctor = new Functor[Fu] {
|
||||
|
|
|
@ -57,7 +57,7 @@ final class Env(
|
|||
import lila.db.api._
|
||||
val cursor = postApi cursor sel
|
||||
cursor.enumerateBulks(1000) run {
|
||||
Iteratee foreach { (postOptions: Iterator[Option[PostModel]]) ⇒
|
||||
Iteratee.foreach({ (postOptions: Iterator[Option[PostModel]]) ⇒
|
||||
val views = (postApi liteViews postOptions.toList.flatten).await
|
||||
esIndexer bulk {
|
||||
views map { view ⇒
|
||||
|
@ -69,7 +69,7 @@ final class Env(
|
|||
).request
|
||||
}
|
||||
}
|
||||
}
|
||||
})(execontext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ private[game] final class Titivate {
|
|||
)).projection(Json.obj("next" -> true))
|
||||
.cursor[JsObject]
|
||||
.enumerateBulks(50) run {
|
||||
Iteratee foreach { (games: Iterator[JsObject]) ⇒
|
||||
Iteratee.foreach((games: Iterator[JsObject]) ⇒
|
||||
games.foreach { game ⇒
|
||||
for {
|
||||
id ← game str "_id"
|
||||
|
@ -50,6 +50,6 @@ private[game] final class Titivate {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)(execontext)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ final class Env(
|
|||
val size = $count(selector).await
|
||||
var nb = 0
|
||||
cursor.enumerateBulks(5000) run {
|
||||
Iteratee foreach { (gameOptions: Iterator[Option[GameModel]]) ⇒
|
||||
Iteratee.foreach((gameOptions: Iterator[Option[GameModel]]) ⇒ {
|
||||
val games = gameOptions.flatten
|
||||
nb = nb + games.size
|
||||
if (size > 1000) loginfo(s"Index $nb of $size games")
|
||||
|
@ -81,7 +81,7 @@ final class Env(
|
|||
).request
|
||||
} toList
|
||||
}
|
||||
}
|
||||
})(execontext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,18 +26,19 @@ object Handler {
|
|||
|
||||
def iteratee(controller: Controller) = {
|
||||
val control = controller orElse baseController
|
||||
Iteratee.foreach[JsValue] { jsv ⇒
|
||||
Iteratee.foreach[JsValue](jsv ⇒
|
||||
jsv.asOpt[JsObject] foreach { obj ⇒
|
||||
obj str "t" foreach { t ⇒
|
||||
control(t -> obj)
|
||||
// TODO handle errors (with lift?)
|
||||
// ~control.lift(t -> obj)
|
||||
}
|
||||
}
|
||||
} mapDone { _ ⇒ socket ! Quit(uid) }
|
||||
)(execontext).mapDone(_ ⇒ socket ! Quit(uid))(execontext)
|
||||
}
|
||||
|
||||
(socket ? join map connecter map {
|
||||
case (controller, enum) ⇒ iteratee(controller) -> enum
|
||||
case (controller, enum) ⇒ iteratee(controller) -> enum
|
||||
}) recover {
|
||||
case t: Throwable ⇒ errorHandler(t.getMessage)
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ final class Env(
|
|||
import play.api.libs.iteratee._
|
||||
import lila.db.api._
|
||||
$cursor[TeamModel](sel).enumerateBulks(100) run {
|
||||
Iteratee foreach { (teamOptions: Iterator[Option[TeamModel]]) ⇒
|
||||
Iteratee.foreach((teamOptions: Iterator[Option[TeamModel]]) ⇒
|
||||
esIndexer bulk {
|
||||
teamOptions.toList.flatten map { team ⇒
|
||||
esIndexer.index_prepare(
|
||||
|
@ -67,7 +67,7 @@ final class Env(
|
|||
).request
|
||||
}
|
||||
}
|
||||
}
|
||||
)(execontext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue