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:
@@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
*/
|
||||
object IntentRateLimiter {
|
||||
const val UNKNOWN_PACKAGE = "<unknown>"
|
||||
private const val UNKNOWN_PACKAGE_LIMIT = 5
|
||||
private const val UNKNOWN_PACKAGE_LIMIT = 3
|
||||
private const val CLEANUP_WHEN_SIZE_EXCEEDS = 256
|
||||
private const val CLEANUP_STALE_MS = 60L * 60L * 1000L
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class IntentRateLimiterTest {
|
||||
@Test
|
||||
fun `unknown package bucket has a tighter limit`() {
|
||||
val unknown = key(pkg = IntentRateLimiter.UNKNOWN_PACKAGE)
|
||||
repeat(5) { assertTrue(IntentRateLimiter.checkAndRecord(unknown)) }
|
||||
repeat(3) { assertTrue(IntentRateLimiter.checkAndRecord(unknown)) }
|
||||
assertFalse(IntentRateLimiter.checkAndRecord(unknown))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user