prepare translation fetch mechanism for production
parent
d4b40b1af1
commit
4b1c940ece
|
@ -5,4 +5,5 @@ public/trans
|
|||
serve/
|
||||
serve/README
|
||||
target
|
||||
bin/.translate_version
|
||||
RUNNING_PID
|
||||
|
|
|
@ -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 ()
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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] = {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue