-
-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Labels
status:ready for adoptionFeel free to implement this issue.Feel free to implement this issue.type:enhancementEnhancementEnhancement
Description
What steps will reproduce the problem?
The save() method is non-atomic, various problems can occur in highly concurrent operations.
and it's inefficient.
What's expected?
Use the Lua script to implement the save operation, and primary keys must be unique.
What do you get instead?
Refactoring the insert method in ActiveRecord class.
$luaScript = <<<EOF
if redis.call('EXISTS', $key) == 0 then
redis.call('RPUSH', $prefixKey, $pkKey)
end
redis.call('HMSET', $setArgs)
return 1
EOF;Additional info
| Q | A |
|---|---|
| Yii vesion | 2.0.40 |
| PHP version | 8.0.1 |
| Operating system | docker |
Metadata
Metadata
Assignees
Labels
status:ready for adoptionFeel free to implement this issue.Feel free to implement this issue.type:enhancementEnhancementEnhancement