Redis-watch monitors a key with an expiration time. What is the result after the key is deleted?

Operation example: Insert picture description here
From the operation example, we can find that watch monitors a key with an expiration time. This key time expires and is deleted, but the transaction after the watch is still executed, so the value of key2 is 2.

to sum up

Watch monitors a key that sets an expiration time. After the key expires and is deleted, watch does not think that the key has been changed, so the transaction can still be executed.

Guess you like

Origin blog.csdn.net/weixin_38106322/article/details/108500568