mobiletto 1.1.21 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/util/redis.js +19 -5
package/package.json
CHANGED
package/util/redis.js
CHANGED
|
@@ -131,13 +131,27 @@ class MobilettoCache {
|
|
|
131
131
|
return await new Promise((resolve, reject) => {
|
|
132
132
|
this.scanner.eachScan(pattern, {}, async (matchingKeys) => {
|
|
133
133
|
for (const key of matchingKeys) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
asyncFunc(key).then(
|
|
135
|
+
(val) => {
|
|
136
|
+
if (typeof val !== 'undefined') {
|
|
137
|
+
logger.debug(`applyToMatchingKeys: found key ${key} = ${val}`)
|
|
138
|
+
results.push(val)
|
|
139
|
+
} else {
|
|
140
|
+
logger.debug(`applyToMatchingKeys: found key with undefined value: ${key}`)
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
(e) => {
|
|
144
|
+
const message = `applyToMatchingKeys: error with key ${key}: ${e}`;
|
|
145
|
+
logger.error(message)
|
|
146
|
+
reject(message)
|
|
147
|
+
})
|
|
138
148
|
}
|
|
139
149
|
}, (err, matchCount) => {
|
|
140
|
-
if (err)
|
|
150
|
+
if (err) {
|
|
151
|
+
logger.error(`applyToMatchingKeys: error in final callback: ${err}`)
|
|
152
|
+
reject(err)
|
|
153
|
+
}
|
|
154
|
+
logger.error(`applyToMatchingKeys: resolving and returning ${results.length} results`)
|
|
141
155
|
resolve(results)
|
|
142
156
|
})
|
|
143
157
|
})
|