mobiletto 1.1.23 → 1.1.24
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 +5 -3
package/package.json
CHANGED
package/util/redis.js
CHANGED
|
@@ -128,16 +128,17 @@ class MobilettoCache {
|
|
|
128
128
|
|
|
129
129
|
applyToMatchingKeys = async (pattern, asyncFunc) => {
|
|
130
130
|
const results = []
|
|
131
|
+
const start = Date.now()
|
|
131
132
|
return await new Promise((resolve, reject) => {
|
|
132
133
|
this.scanner.eachScan(pattern, {}, async (matchingKeys) => {
|
|
133
134
|
for (const key of matchingKeys) {
|
|
134
135
|
asyncFunc(key).then(
|
|
135
136
|
(val) => {
|
|
136
137
|
if (typeof val !== 'undefined') {
|
|
137
|
-
logger.
|
|
138
|
+
logger.silly(`applyToMatchingKeys: found key ${key} = ${val}`)
|
|
138
139
|
results.push(val)
|
|
139
140
|
} else {
|
|
140
|
-
logger.
|
|
141
|
+
logger.silly(`applyToMatchingKeys: found key with undefined value: ${key}`)
|
|
141
142
|
}
|
|
142
143
|
},
|
|
143
144
|
(e) => {
|
|
@@ -151,7 +152,8 @@ class MobilettoCache {
|
|
|
151
152
|
logger.error(`applyToMatchingKeys: error in final callback: ${err}`)
|
|
152
153
|
reject(err)
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
+
const duration = Date.now() - start
|
|
156
|
+
logger.debug(`applyToMatchingKeys: resolving and returning ${results.length} results in ${duration/1000} seconds`)
|
|
155
157
|
resolve(results)
|
|
156
158
|
})
|
|
157
159
|
})
|