API shows the return value to a Boolean result in I can't for the following logic
Is this the official bug? The eldest brother have to know is how to return a responsibility?
Attach the test code
The @autowired
Private StringRedisTemplate StringRedisTemplate;
@ Test
Void contextLoads () {
//here should return true or false but returned to the null effect and set the
Boolean aBoolean=stringRedisTemplate
OpsForValue ()
SetIfAbsent (" key ", "value", 100, TimeUnit. SECONDS);
System. The out. Println (aBoolean);
//a Boolean key=stringRedisTemplate. Expire (" key ", 10, TimeUnit. SECONDS);
//System. Out. Println (key);
}
CodePudding user response:
I tried once, no problem, the same code, I insert returns true on success
CodePudding user response: