mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 06:23:19 -05:00
renamed throttle config option to bufferCount
This commit is contained in:
parent
44432cbd5a
commit
cd6c8d790a
@ -19,7 +19,7 @@ class BackgroundTask(config: Config, captchaManager: CaptchaManager) {
|
|||||||
challengeGCPstmt.executeUpdate()
|
challengeGCPstmt.executeUpdate()
|
||||||
|
|
||||||
val allCombinations = allParameterCombinations()
|
val allCombinations = allParameterCombinations()
|
||||||
val requiredCountPerCombination = Math.max(1, (config.throttle * 1.01) / allCombinations.size).toInt
|
val requiredCountPerCombination = Math.max(1, (config.bufferCount * 1.01) / allCombinations.size).toInt
|
||||||
|
|
||||||
for (param <- allCombinations) {
|
for (param <- allCombinations) {
|
||||||
if (!shutdownInProgress) {
|
if (!shutdownInProgress) {
|
||||||
|
@ -21,7 +21,7 @@ object AttributesEnum extends Enumeration {
|
|||||||
val PORT: Value = Value("port")
|
val PORT: Value = Value("port")
|
||||||
val ADDRESS: Value = Value("address")
|
val ADDRESS: Value = Value("address")
|
||||||
val CAPTCHA_EXPIRY_TIME_LIMIT: Value = Value("captchaExpiryTimeLimit")
|
val CAPTCHA_EXPIRY_TIME_LIMIT: Value = Value("captchaExpiryTimeLimit")
|
||||||
val THROTTLE: Value = Value("throttle")
|
val BUFFER_COUNT: Value = Value("throttle")
|
||||||
val THREAD_DELAY: Value = Value("threadDelay")
|
val THREAD_DELAY: Value = Value("threadDelay")
|
||||||
val PLAYGROUND_ENABLED: Value = Value("playgroundEnabled")
|
val PLAYGROUND_ENABLED: Value = Value("playgroundEnabled")
|
||||||
val CORS_HEADER: Value = Value("corsHeader")
|
val CORS_HEADER: Value = Value("corsHeader")
|
||||||
|
@ -45,7 +45,7 @@ class Config(configFilePath: String) {
|
|||||||
|
|
||||||
val port: Int = configFields.portInt.getOrElse(8888)
|
val port: Int = configFields.portInt.getOrElse(8888)
|
||||||
val address: String = configFields.address.getOrElse("0.0.0.0")
|
val address: String = configFields.address.getOrElse("0.0.0.0")
|
||||||
val throttle: Int = configFields.throttleInt.getOrElse(1000)
|
val bufferCount: Int = configFields.bufferCountInt.getOrElse(1000)
|
||||||
val seed: Int = configFields.seedInt.getOrElse(375264328)
|
val seed: Int = configFields.seedInt.getOrElse(375264328)
|
||||||
val captchaExpiryTimeLimit: Int = configFields.captchaExpiryTimeLimitInt.getOrElse(5)
|
val captchaExpiryTimeLimit: Int = configFields.captchaExpiryTimeLimitInt.getOrElse(5)
|
||||||
val threadDelay: Int = configFields.threadDelayInt.getOrElse(2)
|
val threadDelay: Int = configFields.threadDelayInt.getOrElse(2)
|
||||||
@ -70,7 +70,7 @@ class Config(configFilePath: String) {
|
|||||||
(AttributesEnum.PORT.toString -> 8888) ~
|
(AttributesEnum.PORT.toString -> 8888) ~
|
||||||
(AttributesEnum.ADDRESS.toString -> "0.0.0.0") ~
|
(AttributesEnum.ADDRESS.toString -> "0.0.0.0") ~
|
||||||
(AttributesEnum.CAPTCHA_EXPIRY_TIME_LIMIT.toString -> 5) ~
|
(AttributesEnum.CAPTCHA_EXPIRY_TIME_LIMIT.toString -> 5) ~
|
||||||
(AttributesEnum.THROTTLE.toString -> 1000) ~
|
(AttributesEnum.BUFFER_COUNT.toString -> 1000) ~
|
||||||
(AttributesEnum.THREAD_DELAY.toString -> 2) ~
|
(AttributesEnum.THREAD_DELAY.toString -> 2) ~
|
||||||
(AttributesEnum.PLAYGROUND_ENABLED.toString -> true) ~
|
(AttributesEnum.PLAYGROUND_ENABLED.toString -> true) ~
|
||||||
(AttributesEnum.CORS_HEADER.toString -> "") ~
|
(AttributesEnum.CORS_HEADER.toString -> "") ~
|
||||||
|
@ -23,7 +23,7 @@ case class CaptchaConfig(
|
|||||||
case class ConfigField(
|
case class ConfigField(
|
||||||
port: Option[Integer],
|
port: Option[Integer],
|
||||||
address: Option[String],
|
address: Option[String],
|
||||||
throttle: Option[Integer],
|
bufferCount: Option[Integer],
|
||||||
seed: Option[Integer],
|
seed: Option[Integer],
|
||||||
captchaExpiryTimeLimit: Option[Integer],
|
captchaExpiryTimeLimit: Option[Integer],
|
||||||
threadDelay: Option[Integer],
|
threadDelay: Option[Integer],
|
||||||
@ -32,7 +32,7 @@ case class ConfigField(
|
|||||||
maxAttempts: Option[Integer]
|
maxAttempts: Option[Integer]
|
||||||
) {
|
) {
|
||||||
lazy val portInt: Option[Int] = mapInt(port)
|
lazy val portInt: Option[Int] = mapInt(port)
|
||||||
lazy val throttleInt: Option[Int] = mapInt(throttle)
|
lazy val bufferCountInt: Option[Int] = mapInt(bufferCount)
|
||||||
lazy val seedInt: Option[Int] = mapInt(seed)
|
lazy val seedInt: Option[Int] = mapInt(seed)
|
||||||
lazy val captchaExpiryTimeLimitInt: Option[Int] = mapInt(captchaExpiryTimeLimit)
|
lazy val captchaExpiryTimeLimitInt: Option[Int] = mapInt(captchaExpiryTimeLimit)
|
||||||
lazy val threadDelayInt: Option[Int] = mapInt(threadDelay)
|
lazy val threadDelayInt: Option[Int] = mapInt(threadDelay)
|
||||||
|
Loading…
Reference in New Issue
Block a user