mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
Update rate limiting defaults
This commit is contained in:
@@ -264,8 +264,8 @@ object LocalPreferences {
|
||||
},
|
||||
startServiceOnBoot = getBoolean(SettingsKeys.START_SERVICE_ON_BOOT.key, true),
|
||||
rateLimitEnabled = getBoolean(SettingsKeys.RATE_LIMIT_ENABLED.key, true),
|
||||
rateLimitMaxPerWindow = getInt(SettingsKeys.RATE_LIMIT_MAX_PER_WINDOW.key, 30),
|
||||
rateLimitWindowSeconds = getInt(SettingsKeys.RATE_LIMIT_WINDOW_SECONDS.key, 10),
|
||||
rateLimitMaxPerWindow = getInt(SettingsKeys.RATE_LIMIT_MAX_PER_WINDOW.key, 5),
|
||||
rateLimitWindowSeconds = getInt(SettingsKeys.RATE_LIMIT_WINDOW_SECONDS.key, 30),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ data class AmberSettings(
|
||||
val updateCheckFrequency: UpdateCheckFrequency = UpdateCheckFrequency.DAILY,
|
||||
val startServiceOnBoot: Boolean = true,
|
||||
val rateLimitEnabled: Boolean = true,
|
||||
val rateLimitMaxPerWindow: Int = 30,
|
||||
val rateLimitWindowSeconds: Int = 10,
|
||||
val rateLimitMaxPerWindow: Int = 5,
|
||||
val rateLimitWindowSeconds: Int = 30,
|
||||
) {
|
||||
val useProxy: Boolean get() = torMode != TorMode.DISABLED
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ object IntentRateLimiter {
|
||||
|
||||
internal data class Config(
|
||||
val enabled: Boolean = true,
|
||||
val maxPerWindow: Int = 30,
|
||||
val windowSeconds: Int = 10,
|
||||
val maxPerWindow: Int = 5,
|
||||
val windowSeconds: Int = 30,
|
||||
)
|
||||
|
||||
private val buckets = ConcurrentHashMap<BucketKey, ArrayDeque<Long>>()
|
||||
|
||||
Reference in New Issue
Block a user