我需要在 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 服务器每次请求都执行这些命令?
使用此配置时,我收到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 模块?