小编Alb*_*ert的帖子

如何将 Redis 命令“expire”和“sadd”组合成一个命令?

我需要在 Redis 中创建一个集合:

redis> SADD myset "Hello"
(integer) 1
redis> SADD myset "World"
(integer) 1
redis> SADD myset "World"
(integer) 0
redis> SMEMBERS myset
1) "World"
2) "Hello"
Run Code Online (Sandbox Code Playgroud)

但我需要为密钥设置过期时间myset

换句话说,我需要一种命令expire sadd myset...(例如用于字符串值的 SETEX)。

有没有办法让 Redis 服务器每次请求都执行这些命令?

redis

8
推荐指数
1
解决办法
1万
查看次数

如何在 Gradle 构建文件中正确排除“junit-vintage-engine”?

使用此配置时,我收到initializationErrorJUnit Vintage 的:

testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
Run Code Online (Sandbox Code Playgroud)

但使用此配置@RunWith注释无法解决:

testImplementation (group: 'org.springframework.boot', name: 'spring-boot-starter-test') {
    exclude group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.7.0-M1'
}
Run Code Online (Sandbox Code Playgroud)

如何正确排除 JUnit Vintage 模块?

junit junit4 gradle junit5 junit-vintage

3
推荐指数
1
解决办法
5517
查看次数

标签 统计

gradle ×1

junit ×1

junit-vintage ×1

junit4 ×1

junit5 ×1

redis ×1