mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
fix: test lock for user create (#8415)
* fix: test lock for user create * fix: redis hdel with undefined * feat: add test for undefined key in deleteObjectFields
This commit is contained in:
committed by
GitHub
parent
f0526bff9f
commit
bef37e27cb
@@ -154,7 +154,11 @@ module.exports = function (module) {
|
||||
};
|
||||
|
||||
module.deleteObjectFields = async function (key, fields) {
|
||||
if (!Array.isArray(fields) || !fields.length) {
|
||||
if (!key || !Array.isArray(fields) || !fields.length) {
|
||||
return;
|
||||
}
|
||||
fields = fields.filter(Boolean);
|
||||
if (!fields.length) {
|
||||
return;
|
||||
}
|
||||
await module.client.async.hdel(key, fields);
|
||||
|
||||
Reference in New Issue
Block a user