mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
Minor updates
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
5cafd037d1
commit
0906d6b906
@ -5,7 +5,7 @@ import java.util.concurrent.{ScheduledThreadPoolExecutor, TimeUnit}
|
||||
import lc.core.Captcha
|
||||
import lc.core.{Parameters, Size}
|
||||
|
||||
class BackgroundTask(captcha: Captcha, throttle: Int) {
|
||||
class BackgroundTask(captcha: Captcha, throttle: Int, timeLimit: Int) {
|
||||
|
||||
private val task = new Runnable {
|
||||
def run(): Unit = {
|
||||
@ -22,7 +22,7 @@ class BackgroundTask(captcha: Captcha, throttle: Int) {
|
||||
if (imageNum.next())
|
||||
throttleIn = (throttleIn - imageNum.getInt("total"))
|
||||
while (0 < throttleIn) {
|
||||
captcha.generateChallenge(Parameters("", "", "", Option(Size(0, 0))))
|
||||
captcha.generateChallenge(Parameters("medium", "image/png", "text", Option(Size(0, 0))))
|
||||
throttleIn -= 1
|
||||
}
|
||||
} catch { case e: Exception => println(e) }
|
||||
|
Loading…
Reference in New Issue
Block a user