mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-04-20 18:44:01 -04:00
Minor fixes
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
184d167085
commit
89a1039c87
@ -71,10 +71,10 @@ class Captcha(throttle: Int) {
|
|||||||
val task = new Runnable {
|
val task = new Runnable {
|
||||||
def run(): Unit = {
|
def run(): Unit = {
|
||||||
val imageNum = stmt.executeQuery("SELECT COUNT(*) AS total FROM challenge")
|
val imageNum = stmt.executeQuery("SELECT COUNT(*) AS total FROM challenge")
|
||||||
var throttleIn = throttle + ((10*throttle)/100).asInstanceOf[Int]
|
var throttleIn = (throttle*1.1).toInt
|
||||||
if(imageNum.next())
|
if(imageNum.next())
|
||||||
throttleIn = (throttleIn-imageNum.getInt("total"))
|
throttleIn = (throttleIn-imageNum.getInt("total"))
|
||||||
while(0 <= throttleIn-1){
|
while(0 < throttleIn){
|
||||||
getChallenge(Parameters("","","",Option(Size(0,0))))
|
getChallenge(Parameters("","","",Option(Size(0,0))))
|
||||||
throttleIn -= 1
|
throttleIn -= 1
|
||||||
}
|
}
|
||||||
@ -171,8 +171,8 @@ object LCFramework{
|
|||||||
def main(args: scala.Array[String]) {
|
def main(args: scala.Array[String]) {
|
||||||
val captcha = new Captcha(50)
|
val captcha = new Captcha(50)
|
||||||
val server = new Server(8888)
|
val server = new Server(8888)
|
||||||
server.start()
|
|
||||||
captcha.beginThread(2)
|
captcha.beginThread(2)
|
||||||
|
server.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user