prepare translation fetch mechanism for production

pull/7/merge
Thibault Duplessis 2012-06-16 17:33:20 +02:00
parent d4b40b1af1
commit 4b1c940ece
6 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,4 +5,5 @@ public/trans
serve/
serve/README
target
bin/.translate_version
RUNNING_PID

View File

@ -19,6 +19,7 @@ final class GitWrite(
currentBranch git.currentBranch
_ putStrLn("Current branch is " + currentBranch)
_ (translations map write).sequence map (_ Unit)
_ putStrLn("Checkout " + currentBranch)
_ git checkout currentBranch
} yield ()

View File

@ -23,6 +23,6 @@ class TranslationRepo(
}
def findFrom(id: Int): IO[List[Translation]] = io {
find("_id" $gt id).sort(DBObject("_id" -> 1)).toList
find("_id" $gte id).sort(DBObject("_id" -> 1)).toList
}
}

View File

@ -18,8 +18,7 @@ final class UpstreamFetch(upstreamDomain: String) {
"http://" + upstreamDomain + routes.I18n.fetch(from)
private def fetch(url: String): IO[String] = io {
//Source.fromURL(url).mkString
Source.fromFile(new java.io.File("/home/thib/lila/i18n.json")).mkString
Source.fromURL(url).mkString
}
private def parse(json: String): List[Translation] = {

View File

@ -1 +0,0 @@
0

View File

@ -31,7 +31,7 @@ mongo {
i18n {
web_path.relative = "public/trans"
file_path.relative = "conf"
upstream.domain = "en.l.org"
upstream.domain = "en.lichess.org"
}
monitor {
timeout = 1 second