Skip to content

Commit

Permalink
tweak bulk indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 3, 2015
1 parent b3ee9d3 commit b39c50d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/gameSearch/src/main/GameSearchApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ final class GameSearchApi(client: ESClient) extends SearchReadApi[Game, Query] {
loginfo(s"Index to ${temp.tempIndex.name}")
since.foreach { s => loginfo(s"Since $s") }
val resetStartAt = DateTime.now
val selector = since.fold(Json.obj()) { s =>
lila.game.Query createdSince s.minusHours(3)
}
val selector = since.fold(Json.obj())(lila.game.Query.createdSince)
import lila.db.api._
import lila.game.tube.gameTube
var nb = 0
Expand Down Expand Up @@ -85,7 +83,7 @@ final class GameSearchApi(client: ESClient) extends SearchReadApi[Game, Query] {
}
_ <- temp.aliasBackToMain
_ <- since match {
case None => reset(max, resetStartAt.some)
case None => reset(max, resetStartAt.minusHours(3).some)
case _ => funit
}
} yield ()
Expand Down

0 comments on commit b39c50d

Please sign in to comment.