mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-02-15 04:22:28 -05:00
Add buffer to inital throttle
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
97d703a217
commit
184d167085
@ -71,9 +71,9 @@ 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
|
var throttleIn = throttle + ((10*throttle)/100).asInstanceOf[Int]
|
||||||
if(imageNum.next())
|
if(imageNum.next())
|
||||||
throttleIn = (throttle-imageNum.getInt("total")) + ((10*throttle)/100).asInstanceOf[Int]
|
throttleIn = (throttleIn-imageNum.getInt("total"))
|
||||||
while(0 <= throttleIn-1){
|
while(0 <= throttleIn-1){
|
||||||
getChallenge(Parameters("","","",Option(Size(0,0))))
|
getChallenge(Parameters("","","",Option(Size(0,0))))
|
||||||
throttleIn -= 1
|
throttleIn -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user