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:
Barış Soner Uşaklı
2020-06-18 23:16:48 -04:00
committed by GitHub
parent f0526bff9f
commit bef37e27cb
4 changed files with 65 additions and 3 deletions

View File

@@ -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);