Minor updates

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar 2021-03-02 21:34:38 +05:30
parent 5cafd037d1
commit 0906d6b906
No known key found for this signature in database
GPG Key ID: 0D2CE231A7287EBC

View File

@ -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) }