File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
kacheable-lettuce/src/main/kotlin/com/github/dave08/kacheable Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ plugins {
3
3
}
4
4
5
5
group = " org.github.dave08.kacheable"
6
- version = " 0.1.2 "
6
+ version = " 0.1.4 "
7
7
8
8
kotlin {
9
9
jvmToolchain(11 )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import kotlin.time.Duration
13
13
class RedisKacheableStore (
14
14
private val conn : StatefulRedisConnection <String , String >,
15
15
private val deleteFromPatternInChunksOf : Int = 20 ,
16
+ private val deleteScanCount : Long = 1000 ,
16
17
) : KacheableStore {
17
18
18
19
override suspend fun delete (key : String ) {
@@ -21,7 +22,7 @@ class RedisKacheableStore(
21
22
else withContext(Dispatchers .IO ) {
22
23
val commands = conn.sync()
23
24
24
- ScanIterator .scan(commands, ScanArgs ().match(key)).asSequence()
25
+ ScanIterator .scan(commands, ScanArgs ().match(key).limit(deleteScanCount) ).asSequence()
25
26
.chunked(deleteFromPatternInChunksOf)
26
27
.forEach { keys ->
27
28
if (keys.isNotEmpty()) commands.del(* (keys.toTypedArray()))
You can’t perform that action at this time.
0 commit comments