@nxtedition/nxt-undici 6.2.29 → 6.2.30
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/lib/interceptor/cache.js +12 -2
- package/package.json +1 -1
package/lib/interceptor/cache.js
CHANGED
|
@@ -164,7 +164,12 @@ class CacheHandler extends DecoratorHandler {
|
|
|
164
164
|
try {
|
|
165
165
|
this.#store.set(this.#key, this.#value)
|
|
166
166
|
} catch (err) {
|
|
167
|
-
|
|
167
|
+
if (err.message === 'database is locked') {
|
|
168
|
+
// Database is busy. We don't bother trying again...
|
|
169
|
+
this.#logger?.debug({ err }, 'failed to set cache entry')
|
|
170
|
+
} else {
|
|
171
|
+
this.#logger?.error({ err }, 'failed to set cache entry')
|
|
172
|
+
}
|
|
168
173
|
}
|
|
169
174
|
this.#value = null
|
|
170
175
|
}
|
|
@@ -207,7 +212,12 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
207
212
|
try {
|
|
208
213
|
entry = store.get(opts)
|
|
209
214
|
} catch (err) {
|
|
210
|
-
|
|
215
|
+
if (err.message === 'database is locked') {
|
|
216
|
+
// Database is busy. We don't bother trying again...
|
|
217
|
+
opts.logger?.debug({ err }, 'failed to set cache entry')
|
|
218
|
+
} else {
|
|
219
|
+
opts.logger?.error({ err }, 'failed to set cache entry')
|
|
220
|
+
}
|
|
211
221
|
}
|
|
212
222
|
|
|
213
223
|
if (!entry && !cacheControlDirectives['only-if-cached']) {
|