Closed RomanRabirokh closed 5 years ago
This command uses 'NX' option:
NX
-- Only set the key if it does not already exist.
In this case null
will be returned:
Simple string reply: OK if SET was executed correctly. Null reply: a Null Bulk Reply is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.
@rob006 Sorry)You're right)
https://github.com/yiisoft/yii2-redis/blob/332f2efd09830e4c4c6cff405dfb2f75859eea29/src/Mutex.php#L113
maybe I don’t understand the mutex mechanism
But redis allows you to create keys with the same name.
that is, the installation will always be performed on this line.
such a command can be executed as many as you want without errors. SET mykey "Hello" ex 100
Based on this, the lock will never work.