@nxtedition/cache 1.0.11 → 1.0.13
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/index.js +6 -4
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseSync,
|
|
1
|
+
import { DatabaseSync, } from 'node:sqlite'
|
|
2
2
|
import { MemoryCache, } from "./memory.js"
|
|
3
3
|
|
|
4
4
|
|
|
@@ -215,7 +215,9 @@ export class AsyncCache {
|
|
|
215
215
|
try {
|
|
216
216
|
this.#memory?.purgeStale(fastNow())
|
|
217
217
|
this.#purgeStaleQuery?.run(fastNow())
|
|
218
|
-
} catch {
|
|
218
|
+
} catch (err) {
|
|
219
|
+
process.emitWarning(err )
|
|
220
|
+
}
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
#load(args , refresh ) {
|
|
@@ -368,12 +370,12 @@ export class AsyncCache {
|
|
|
368
370
|
})
|
|
369
371
|
|
|
370
372
|
try {
|
|
371
|
-
this.#setQuery?.run(key, data
|
|
373
|
+
this.#setQuery?.run(key, data , ttl, stale)
|
|
372
374
|
} catch (err) {
|
|
373
375
|
if ((err )?.errcode === 13 /* SQLITE_FULL */) {
|
|
374
376
|
try {
|
|
375
377
|
this.#evictQuery?.run(256)
|
|
376
|
-
this.#setQuery?.run(key, data
|
|
378
|
+
this.#setQuery?.run(key, data , ttl, stale)
|
|
377
379
|
} catch {
|
|
378
380
|
process.emitWarning(err )
|
|
379
381
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/cache",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"rimraf": "^6.1.2",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "12c38fec15bd155797cb1edae372a81061715df3"
|
|
32
32
|
}
|