Skip to content

Commit

Permalink
log better, log less
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Oct 23, 2012
1 parent 9293b17 commit adcc776
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/RoundEventPerformer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait RoundEventPerformer {

protected def perform(fullId: String, op: String IOValidEvents): IO[Unit] =
op(fullId) flatMap { validEvents
validEvents.fold(putFailures, performEvents(fullId))
validEvents.fold(_ => io(), performEvents(fullId))
}

protected def performEvents(fullId: String)(events: List[Event]): IO[Unit] = io {
Expand Down
8 changes: 4 additions & 4 deletions app/round/Socket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ final class Socket(
}
case Some("moretime") (for {
res hand moretime povRef
op res.fold(putFailures, events io(hub ! Events(events)))
op res.fold(_ io(), events io(hub ! Events(events)))
} yield op).unsafePerformIO
case Some("outoftime") (for {
res hand outoftime povRef
op res.fold(putFailures, events io(hub ! Events(events)))
op res.fold(_ io(), events io(hub ! Events(events)))
} yield op).unsafePerformIO
case _
}
Expand Down Expand Up @@ -170,9 +170,9 @@ final class Socket(

private def isHijack(pov: Pov, token: Option[String], ctx: Context) =
if (hijacks contains pov.fullId) true
else if (token != pov.game.token.some) true ~ { _
else if (token != pov.game.token.some) true ~ { _
println("[websocket] hijacking detected %s %s".format(pov.fullId, ctx.toString))
hijacks += pov.fullId
hijacks += pov.fullId
}
else false
}
2 changes: 1 addition & 1 deletion app/search/Indexer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class Indexer(
ids queue next 2000
_ ids.toNel.fold(
neIds for {
_ putStrLn("Search indexing %d games" format neIds.list.size)
_ putStrLn("[search] indexing %d games" format neIds.list.size)
_ indexQuery("_id" $in neIds.list)
_ queue remove neIds.list
} yield (),
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

app.dbLock = new SpeedOMeter({
name : "DB LOCK",
maxVal : 5,
maxVal : 10,
container : container
});

Expand Down
2 changes: 0 additions & 2 deletions todo
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ not possible to copy the link URL invite when using a iOS device. Can this be ea
search bug https://en.lichess.org/games/search?players.a=&players.b=&players.winner=&eloMin=&eloMax=&hasAi=&aiLevelMin=&aiLevelMax=&variant=&mode=1&opening=&turnsMin=&turnsMax=&durationMin=&durationMax=&status=35&dateMin=&dateMax=&sort.field=tu&sort.order=asc
takeback substract time for person granting
add fullscreen mode for spectators and load new games in a loop (based on certain filter options) - thus creating a chess tv channel

db.pgn.find({},{_id:1}).forEach(function(o) { if (0 === db.game4.count({_id: o._id})) { print(o._id); db.pgn.remove({_id: o._id});} });

0 comments on commit adcc776

Please sign in to comment.