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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util/redis.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, and local storage",
5
5
  "main": "index.js",
6
6
  "keywords": [
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.debug(`applyToMatchingKeys: found key ${key} = ${val}`)
138
+ logger.silly(`applyToMatchingKeys: found key ${key} = ${val}`)
138
139
  results.push(val)
139
140
  } else {
140
- logger.debug(`applyToMatchingKeys: found key with undefined value: ${key}`)
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
- logger.error(`applyToMatchingKeys: resolving and returning ${results.length} results`)
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
  })