graphile-cache 3.11.2 → 3.12.1
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/esm/graphile-cache.js +5 -2
- package/graphile-cache.d.ts +4 -1
- package/graphile-cache.js +5 -2
- package/package.json +5 -5
package/esm/graphile-cache.js
CHANGED
|
@@ -21,16 +21,19 @@ export const cacheEvents = new CacheEventEmitter();
|
|
|
21
21
|
* Get cache configuration from environment variables
|
|
22
22
|
*
|
|
23
23
|
* Supports:
|
|
24
|
-
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default:
|
|
24
|
+
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default: 50)
|
|
25
25
|
* - GRAPHILE_CACHE_TTL_MS: TTL in milliseconds
|
|
26
26
|
* - Production default: ONE_YEAR
|
|
27
27
|
* - Development default: FIVE_MINUTES_MS
|
|
28
|
+
*
|
|
29
|
+
* NOTE: This value should be <= PG_CACHE_MAX (also default: 50) so that
|
|
30
|
+
* every cached PostGraphile instance has a live pool backing it.
|
|
28
31
|
*/
|
|
29
32
|
export function getCacheConfig() {
|
|
30
33
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
31
34
|
const max = process.env.GRAPHILE_CACHE_MAX
|
|
32
35
|
? parseInt(process.env.GRAPHILE_CACHE_MAX, 10)
|
|
33
|
-
:
|
|
36
|
+
: 50;
|
|
34
37
|
const ttl = process.env.GRAPHILE_CACHE_TTL_MS
|
|
35
38
|
? parseInt(process.env.GRAPHILE_CACHE_TTL_MS, 10)
|
|
36
39
|
: isDevelopment
|
package/graphile-cache.d.ts
CHANGED
|
@@ -25,10 +25,13 @@ export interface CacheConfig {
|
|
|
25
25
|
* Get cache configuration from environment variables
|
|
26
26
|
*
|
|
27
27
|
* Supports:
|
|
28
|
-
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default:
|
|
28
|
+
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default: 50)
|
|
29
29
|
* - GRAPHILE_CACHE_TTL_MS: TTL in milliseconds
|
|
30
30
|
* - Production default: ONE_YEAR
|
|
31
31
|
* - Development default: FIVE_MINUTES_MS
|
|
32
|
+
*
|
|
33
|
+
* NOTE: This value should be <= PG_CACHE_MAX (also default: 50) so that
|
|
34
|
+
* every cached PostGraphile instance has a live pool backing it.
|
|
32
35
|
*/
|
|
33
36
|
export declare function getCacheConfig(): CacheConfig;
|
|
34
37
|
/**
|
package/graphile-cache.js
CHANGED
|
@@ -28,16 +28,19 @@ exports.cacheEvents = new CacheEventEmitter();
|
|
|
28
28
|
* Get cache configuration from environment variables
|
|
29
29
|
*
|
|
30
30
|
* Supports:
|
|
31
|
-
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default:
|
|
31
|
+
* - GRAPHILE_CACHE_MAX: Maximum number of entries (default: 50)
|
|
32
32
|
* - GRAPHILE_CACHE_TTL_MS: TTL in milliseconds
|
|
33
33
|
* - Production default: ONE_YEAR
|
|
34
34
|
* - Development default: FIVE_MINUTES_MS
|
|
35
|
+
*
|
|
36
|
+
* NOTE: This value should be <= PG_CACHE_MAX (also default: 50) so that
|
|
37
|
+
* every cached PostGraphile instance has a live pool backing it.
|
|
35
38
|
*/
|
|
36
39
|
function getCacheConfig() {
|
|
37
40
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
38
41
|
const max = process.env.GRAPHILE_CACHE_MAX
|
|
39
42
|
? parseInt(process.env.GRAPHILE_CACHE_MAX, 10)
|
|
40
|
-
:
|
|
43
|
+
: 50;
|
|
41
44
|
const ttl = process.env.GRAPHILE_CACHE_TTL_MS
|
|
42
45
|
? parseInt(process.env.GRAPHILE_CACHE_TTL_MS, 10)
|
|
43
46
|
: isDevelopment
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-cache",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PostGraphile v5 LRU cache with automatic pool cleanup integration",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@pgpmjs/logger": "^2.11.
|
|
32
|
+
"@pgpmjs/logger": "^2.11.1",
|
|
33
33
|
"express": "^5.2.1",
|
|
34
34
|
"grafserv": "1.0.0",
|
|
35
|
-
"graphile-realtime-subscriptions": "^0.7.
|
|
35
|
+
"graphile-realtime-subscriptions": "^0.7.2",
|
|
36
36
|
"lru-cache": "^11.2.7",
|
|
37
|
-
"pg-cache": "^3.
|
|
37
|
+
"pg-cache": "^3.11.1",
|
|
38
38
|
"postgraphile": "5.0.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"constructive",
|
|
53
53
|
"v5"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "423992019655cc1e780149ce3f7e6e8c9b1c6e80"
|
|
56
56
|
}
|